Final Exam Comp Programming1
Final Exam Comp Programming1
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.