You are on page 1of 2

Republic of the Philippines

NUEVA ECIJA UNIVERSITY OF SCIENCE AND


Cabanatuan City, Nueva Ecija, Philippines
ISO 9001:2015 CERTIFIED
COLLEGE OF INFORMATION TECHNOLOGY
IT-PF01 - FINAL EXAMINATION
Object Oriented Programming I
1ST SEM, SY 2022-2023

Name: _____________________________________________ Score: ___________


Year & Section: _____________________________________ Date: ____________
I. Multiple Choice: Encircle the correct answer.

1. It is a loop that runs forever.


a. definite b. infinite c. indefinite d. none of the choices
2. You use this type of loop if you want the loop body to be run at least once.
a. for loop b. while loop c. do-while loop d. none of the choices
3. It is a special loop that where the loop iteration count is defined.
a. Event-controlled loop b. Controlled loop c. Pretest loop d. Posttest loop
4. An increment operator where the result is calculated first before the vaue gets stored and used?
a. Postfix ++ b. Prefix ++ c. Both a and b d. None of the a and b
5. An increment operator where the variable will be used first in the code before its new value is
calculated and stored.
a. Postfix ++ b. Prefix ++ c. Both a and b d. None of the a and b
6. Which of the choices denotes an increment operator?
a. X++ b. ++X c. Both a and b d. None of the a and b
7. Which of the choices denotes a decrement operator?
a. X-- b. –X c. Both a and b d. None of the a and b
8. If the value of a is 5, what is now the value of an after a++;
a. 4 b. 5 c. 6 d. 5++
9. If x=5, y=3, then what is the value of x and y if x=y++;
a. x is 3 and y is 4 b. both x and y is 4 c. x is 4 and y is 3 d. both x and y is 3
10. If x=5, y=3, then what is the value of x and y if x=++y;
a. x is 3 and y is 4 b. both x and y is 4 c. x is 4 and y is 3 d. both x and y is 3
11. If x=5, y=3, then what is the value of x and y if x=y--;
a. x is 3 and y is 2 b. both x and y is 3 c. x is 5 and y is 2 d. both x and y is 3
12. If x=5, y=3, then what is the value of x and y if x=--y;
a. x is 3 and y is 2 b. both x and y is 2 c. x is 5 and y is 2 d. both x and y is 3
13. Choose one of the arguments below of the Font type.
a. style b. Bold c. Italic d. Typeface
14. “These are popup windows than can help a user to understand the purpose of components in
an application.”
a. tooltips b. text messages c. setToolTipText d. none of the choices
15. “This is a component into which a user can type a single line of text od data.”
a. JTextBox b. TextField c. JTextField d. none of the choices
16. From the following, pick what Swing package belongs to
a. Font b. JFrame c. ActionListener d. TextField
17. From the following, pick what AWT package belongs to
a. Font b. Bold c. Italic d. FlowLayout
18. “What do you call to the built-in Java Swing class that holds text you can display?”
a. Label b. JLabel c. JTextField d. TextField
19. “This method adds a component to a JFrame.”
a. Add(); b. add(); c. both a and b d. None of the choices
20. Which of the following keyword should you use if you want to use an existing class from the Java
class Library?
a. import b. new c. static d. use

Transforming Communities through Science and Page 1 of 2


Technology
Republic of the Philippines
NUEVA ECIJA UNIVERSITY OF SCIENCE AND
Cabanatuan City, Nueva Ecija, Philippines
ISO 9001:2015 CERTIFIED
COLLEGE OF INFORMATION TECHNOLOGY
II. Problem Solving: Solve the following problems: (10 pts each)
1. Directions: Write an application using a loop that will display the following. 10 20 30 40 50.
Your Program Code here:

2. Write an application that will ask the user to input a number. Your program will then
display a number that starts and ends based on the number you entered and on the right side to
reverse the numbers you displayed on the left side. See the sample output below.
Enter a Number: 5
1 5
2 4
3 3
4 2
5 1

3. Write an application which will apply as follows:JFrame


JLabel JTextField JButton
Tool Tip Extends AWT
Font FlowLayout

Prepared by:
ALVIN S. ENRICO
Instructor

Noted:

RONALDO C. ARIMBUYUTAN LORNA G. PATOC


Chair, IT Department Campus Director

Transforming Communities through Science and Page 2 of 2


Technology

You might also like