0% found this document useful (0 votes)
358 views2 pages

C++ Programming 3RD Quarter Test

This document appears to be a practice exam for a Java Programming class. It contains 3 sections - a True/False section, a multiple choice section, and a code completion section. The code completion section asks students to fill in missing code for basic Java programming tasks like declaring variables, taking user input, and performing calculations.

Uploaded by

AileenD.Enriquez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
358 views2 pages

C++ Programming 3RD Quarter Test

This document appears to be a practice exam for a Java Programming class. It contains 3 sections - a True/False section, a multiple choice section, and a code completion section. The code completion section asks students to fill in missing code for basic Java programming tasks like declaring variables, taking user input, and performing calculations.

Uploaded by

AileenD.Enriquez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Republic of the Philippines

Department of Education
Region IV-A (CALABARZON)
Division of San Pablo City
CRECENCIA DRUSILA LOPEZ SENIOR HIGH SCHOOL
(San Pablo City Senior High School-Stand Alone)
DLMP Compound, Brgy. San Roque, San Pablo City

3rd Quarterly Examination


Java Programming
A.Y. 2018 – 2019 (2nd Semester)

Name: _________________________________ Grade & Section: ______________

General Instruction:
A. Read the instructions in every test type.
B. Select the best answer to the following questions.
C. Write the correct answer on the space provided before each number.
D. No erasures.

I. WRITE TRUE IF THE ANSWER IS CORRECT AND FALSE IF THE ANSWER IS


WRONG.
___________ 1 C++ is a low level language
__________ 2 A blank line. C++ ignores white space.
_
__________ 3 Cout is pronounced as "kawt"
_
__________ 4 Every C++ statement ends with a semicolon ;.
_
__________ 5 The double data type stores integers without decimals
_
__________ 6 The char data type stores single characters
_
__________ 7 x+=5 is the same as x=x+5
_
__________ 8 x=3 is the same as x==3
_
__________ 9 & is and operator used for NOT operation
_
__________ 10 Looping statements are used to execute a block of statement while the condition is TRUE
_

II. CHOOSE FROM THE LIST BELOW THE CORRECT ANSWER FOR EACH OF
THE FOLLOWING
&& iostream Return 0 Double
++ C++ /n cin
break max \n String

______________________ 1 a cross-platform language that can be used to create high-performance


applications.
______________________ 2 a header file library that lets us work with input and output objects, such
as cout
______________________ 3 ends the main function
______________________ 4 a code to insert a new line
______________________ 5 numbers with decimal points
______________________ 6 stores text, such as "Hello World".
______________________ 7 a predefined variable that reads data from the keyboard with the extraction
operator
______________________ 8 an operator that increases the value of a variable by 1
______________________ 9 Returns true if both statements are true
______________________ 10 returns the highest value in the list
III. WRITE THE CORRECT CODE TO COMPLETE THE PROGRAM. (30 POINTS)

int main() { Insert a new line after "Hello World", by using a


special character:
<< "Hello World!"; int main() {
return 0;
} cout << "Hello World! ";
cout << "I am learning C++";
return 0;
}
Comments in C++ are written with special Create a variable named myNum and assign the
characters. Insert the missing parts: value 50 to it.

This is a single-line comment = ;


This is a multi-line comment

Display the sum of 5 + 10, using two Create a variable called z, assign x + y to it, and
variables: x and y. display the result.

int x = 5;
= int y = 10;
; = x + y;
int y = 10;
cout << x + y; cout << ;

Fill in the missing parts to create three variables Use the correct keyword to get user input, stored in the
of the same type, using a comma-separated list: variable x:

int x;
x=5 y=6 cout << "Type a number: ";
z = 50; >> ;
cout << x + y + z;

Fill in the missing parts to print the sum of two Add the correct data type for the following variables:
numbers (which is put in by the user):

int x, y; myNum = 9;
int sum; myDoubleNum = 8.99;
cout << "Type a number: ";
myLetter = 'A';
>> ;
cout << "Type another number: "; myBool = false;

>> ; myText = "Hello World";


sum = x + y;
cout << "Sum is: " << ;

You might also like