Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

La Union Colleges of Science Technology, Inc.

Central West, Bauang, La Union

Computer Programming 1
Diploma in Information Technology (Batch 1)
Final Examination – 22 copies

I. Identification. Give the word(s) that best describe the sentence. 20pts.
1. It is the phase where programs perform the actions specified by the program.
2. It is the phase where program must be place in memory before it can execute a process.
3. It is the phase where it translates the Java spruce code into bytecodes that represent the tasks to be performed.
4. A collection of related objects
5. Can be viewed as a list of items in memory
6. Store a table of data.
7. It allows the programmer to modularize a program by separating tasks into self-contained units.
8. It refers to the list of variables in a method declaration
9. This refers to the actual values that are passed in when the method is invoked.
10. When declaring a parameter to a method or a constructor this is provided for that parameter

II. True or False. Write True if the statement is true otherwise false. 10pts.
1. // indicates a comment lines
2. Blank lines can be used to so that programs are easier to read.
3. A left brace indicates the beginning of the body of a class declaration.
4. System.out allows Java applications to display characters in the command window.
5. Scanner searches for token in input.
6. A loop is a repetitive execution of a group of statements.
7. For is a combination of initialization, condition, and iteration steps of a loop processing.
8. While executes a loop body statement repeatedly as long as the controlling-condition is true.
9. A static method belongs to the class rather than object of a class.
10. Every class provides methods that perform common tasks on objects of the class

III. Fill in the blanks. Complete the sentence by give the missing word on the space. 5pts.
1. _______ defines 2 or more methods w/in the same class that share the same name, as long as their parameter declaration are
different.
2. Method overloading is one of the ways that Java supports polymorphism _____________.
3. When an overloaded method is invoked. Java uses the type and /or number of ____ as its guide to determine which version of the
overloaded method actually calls.
4. When an overloaded method is called. Java looks for a match bet. the arguments used to call the method & the method’s ____________ .
5. To understand how, consider the following. In languages that do not support method overloads each method must be given a
___________ name.

IV. Matching Type. Match column A with column B by writing the letter of your choice. 5pts.
Column A Column B
1. Integers a. the representation f values
2. Floating-point numbers b. Used for logical values like true or false
3. Characters c. A data type used to store characters
4. Boolean d. Used when evaluating expressions that require fractional parts.
5. Literals e. Signed positive and negative values.

V. Multiple choice. Write the letter of your choice. 10pts.


1. It is used in mathematical expressions in the same way that they are used in algebra.
a. Arithmetic b. bitwise c. relational d. Boolean
2. It determines the relationship of one operand to other operands.
a. Arithmetic b. bitwise c. relational d. Boolean
3. It only operates on Boolean operands.
a. Arithmetic b. bitwise c. relational d. Boolean
4. It is used to direct program execution in two different routes.
a. If b. switch c. default d. break
5. It is used for forward execution to different parts of the user’s program based on the value of an expression.
a. If b. switch c. default d. break
6. Java provides how many levels of access modifiers to set access levels for classes, variables, methods and constructors.
a. 1 b. 2 c. 3 d. 4
7. It means we do not explicitly declare an access modifier for a class, field, method.
a. Default b. private c. public d. protected
8. It can only be accessed within the declared class itself.
a. Default b. private c. public d. protected
9. It can be accessed from any other class.
a. Default b. private c. public d. protected
10. It can be accessed only by the subclasses in other package
a. Default b. private c. public d. protected

You might also like