You are on page 1of 2

Republic of the Philippines

NUEVA ECIJA UNIVERSITY OF SCIENCE AND TECHNOLOGY


GABALDON CAMPUS
Gabaldon, Nueva Ecija
MIDTERM FORMATIVE ASSESSMENT
ITPF01 Object Oriented Programming 1
Name: Score: _________
Year & Section: ________________________________ Date:_________________

I. Multiple Choice, Encircle the correct answer.


1. What is the term used to refer to the rule of a language?
a. Object b. Syntax c. Program d. Class
2. What is the file extension for a Java source code?
a. .java b. .exe c. .class d. .javac
3. All methods in Java have at the end.
a. “ “ b. { } c. () d. []
4. Which of these is an object-programming language?
a. Ball b. Java c. Polymorphism d. Inheritance
5. What is the file extension of a compiled Java program?
a. .java b. .exe c. .class d. .javac
6. In order to compile a program named Sample, what do you type in the command line?
a. javac Sample.java b. java Sample c. Sample.java d.java Sample.java
7. Which of these is a programming language?
a. Facebook b. Windows XP c. Java d. Twitter
8. Literal String must be enclosed with ?
a. “ “ b. { } c. () d. []
9. What is the correct command in order to run a Java application with a file name
Sample.java ?
a. javac Sample.java b. java Sample c. Sample.java d. java Sample.java
10. All java programming statements must end with a ?
a. Period b. Semicolon c. Comma d. Colon

II. Problem Solving. Solve the following code: (2 pts each)

11. What is the valid way to declare an integer variable named num?
a. Int num; b. int num; c. integer num; d. num int;
12. Give the answer to the following code sequence:
int num=4;
int result= num/0;
System.out.print(result) ;
13. Give the answer to the following code sequence:
double grade=2.5/0;
System.out.print(grade) ;
14. Give the answer to the following code sequence:
double num=0.0/0.0;
System.out.print(num) ;
15. Give the answer to the following code sequence:
int num= 4/2*2;
System.out.print(num) ;
II. Problem Solving. Write the program code of the following: (10 pts each).

Note: you ca use separate sheet of paper for your code.

1. Directions: Write a program that prints the three first letters of your name. You’re
your program code here:

2. Directions: Write a Java application using JOptionPane that will input your given name but
the output will be your complete name following order: LastName, GivenName
MiddleName
your program code here:

3. Directions: Write a Java application that will accept three numbers and that will
compute the average. Your program is required to apply type casting (implicit or
explicit).
your program code here:

Prepared by:
ALVIN S. ENRICO
Instructor

Noted:

RONALDO C. ARIMBUYUTAN LORNA G. PATOC


Chair, IT Department Campus Director

You might also like