You are on page 1of 4

QUEZON INSTITUTE OF TECHNOLOGY

Quezon, Bukidnon

Name__________________________________________ COMPUTER PROGRAMMING Score:_________

PRELIMINARY EXAMINATION FOR PROGRAMMING

TEST 1: MULTIPLE CHOICE: Read the item carefully and choose the best answer. Write your answer on the space
provided each number

_________1.) What is referred to a programmable machine designed to follow instructions?


a. Digital b. Analog c. Computer d. Programs
_________2.) Which persons below is responsible to write instructions (programs) to make computer perform a task.
a. Programmer b. Technician c. Operator d. Designer
_________3.) The Central Processing Unit has a couple of blocks. Each block has assigned tasks to be performed. One
of them is to retrieve and decode program instructions and coordinates activities of all other parts of the computer. What
particular block is assigned to do such tasks?
a. Data Storage b. Instruction Cache c. Control Unit d. Arithmetic Logic Unit
_________4.) How about optimizing hardware for high-speed numeric calculation and designed for true/false, yes/no
decisions. Which blocks is responsible to perform such tasks?
a. Data Storage b. Instruction Cache c. Control Unit d. Arithmetic Logic Unit
_________5.) The word “volatile” means -
a. Erase when program terminates. b. Retain when program terminates.
c. Restore when program terminates. d. Save when program terminates.
_________6.) What device to be used if the user wants to input letters, numbers and symbols to the computer?
a. Monitor b. Keyboard c. Speaker d. Printer
_________7.) If you want to print the input data from your computer, which of the following devices would be most
applicable to use?
a. input device b. output device c. primary storage device d. secondary storage device

_________8.) If you want to convert source file directives to source code program statements, what high level program
will you need to run?
a. Compiler b. Preprocessor c. Code Converter d. Debugger
_________9.) What do you call a programming tool which convert source program into machine instructions?
a. Compiler b. Preprocessor c. Linker d. Updater
_________10.) Connecting hardware-specific code to machine instructions and producing an executable file is the
responsibility of_______.
a. Compiler b. Preprocessor c. Coder d. Linker
_________11.) Type casting is used for manual data type conversion. Which of the following syntax below follows the
correct format?
a. static_cast<data type> value b. static_cast<expression> value c. static_cast<data type> parameter
_________12.) Which programming language capabilities have a special meaning and can not be used for any other
purpose?
a. keywords b. linkers c. syntax d. Compiler
_________13.) Which of the following programmer-defined identifiers holds exact assigned literals?
a. int num=’R’; b. int num=2.5; c. int num= -.5; d. int num = 10;
_________14.) If you want the computer perform operations on data such as adding, subtracting, dividing, multiplying,
and etc., Which C++ capabilities to be used?
a. keywords b. identifiers c. operators d. reference
_________15.) The characters (endl) mark the end of a statement, or separate items in a list such as comma and
semicolon are known as
a. punctuation b. programmer-defined identifiers c. expression d. reference
_________16.) double number1, number2, number3; Which of the statements below clearly explain the word double?
a. The word double specifies that the variables can hold single-precision floating point numbers
b. The word double specifies that the variables can hold decimal-precision floating point numbers
c. The word double specifies that the variables can hold double-precision floating point numbers
d. The word double specifies that the variables can hold long-precision floating point numbers
_________17.) What do you call a C++ standard object displays output on the screen with the use of stream insertion
operator?
a. cout b. cin c. double d. int
_________18.) The integer variables can hold whole numbers such as 12, 7, and -99. Which of the following declared
variables not holding integer values?
a. int a = 3; b. double b = 4.5; c. short c = 8; d. long d = 100;
_________19.) Which of the following operators would be the most appropriate operator to be used to determine the size
of a data type?
a. indexof b. sizeof c. valueof d. expressionof
_________20.) Which of the following C++ operators below applied for assigning values to the variables and identifiers?
a. + b. / c. >> d. =
_________21.) What is referred to a part of the program in which the variable can be accessed and a variable cannot be
used before it is defined?
a. scope b. Literal c. Integral d. parameter
_________22.) To get the remainder from the division operation, binary arithmetic operator shall be used. Which of the
following operators below will you need to use?
a. / b. % c. * d. +
_________23.) Comments are used to document parts of the program so that persons reading the source code of the
program will understand the program flow: Which of the following symbols bellow is for comments?
a. # b. // c. ‘ d. ^
_________24.) int a = 9; What is the meaning of 9 value?
a. String Literal b. Integer Literal c. Character Literal d. Bool
_________25.) Which of the following symbols below for the Multi-Line comments?
a. #* *# b. // // c. /* */ d. /( )/
_________26.) Which of the following coercions will convert automatically a certain operand to another data type?
a. Type Coercion b. Promotion Coercion c. Demotion Coercion
_________27.) Which applicable coercion type will convert to a higher type or values?
a. Type Coercion b. Promotion Coercion c. Demotion Coercion
_________28.) When type needed to be converted into lower type, which coercions will do the conversion?
a. Type Coercion b. Promotion Coercion c. Demotion Coercion
_________29.) Which of the following codes below is referred to as constant value?
a. const double TAX_RATE = 0.0675; b. double TAX_RATE = 0.0675; c. TAX_RATE = 0.0675;

_________30.) int a=5, b=6, c=9, d=4, e=15;


int f;
f = f = (((a*c)/e)+b)-d;
cout<< f;

What is the output of this program?


a. 5 b. 10 c. 51 d. 71

Test II: Problem Solving and Programming (@ Comlab 50 points)

Consider the average calculation of your first grading period. As if you do have 8 subjects such as Math,
Science, English, Filipino, Araling Panlipunan, Physical Education, TVE, and Values Education. Assuming that
you have grades already for each subject. Now, develop a C++ program that will accept grades input per
subject, compute and display the average.

1. Make an Algorithm and Pseudo-code (10 pts)


2. Illustrate in a form of Flow Chart (10 pts)
3. Create Program Code (25 pts)
4. Test/Evaluate the Program Code ( 5 pts)
Problem 1:
(EXPECTED OUTPUT)

Test your application by following the instructions below.


1. Your program will display this output:

WELCOME TO AVERAGE CALCULATOR PROGRAM

Enter your name: JUAN DELA CRUZ


Enter your section: RAMBUTAN

2. Once you have entered the input above, then press ENTER KEY, it will generate the following:

*******************************************
Hi! JUAN DELA CRUZ OF RAMBUTAN
NOW PLEASE ENTER YOUR GRADES EACH SUBJECT

Enter your grades in Math: 90


Enter your grades in Science: 90
Enter your grades in English: 90
Enter your grades in Filipino: 90
Enter your grades in Araling Panlipunan: 90
Enter your grades in Physical Education: 90
Enter your grades in TVE: 90
Enter your grades in Values Education: 90
********************************************
3. After entering the grades value, then press ENTER KEY, it will generate the following:

HELLO! JUAN DELA CRUZ OF RAMBUTAN


YOUR AVERAGE IS : 90

THANK YOU FOR USING THE PROGRAM

*********************************************
Press any key to continue

Problem II: Computing Body Mass Index


Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your
weight in kilograms and dividing by the square of your height in meters. The interpretation of
BMI for people 16 years or older is as follows:
BMI Interpretation
below 16 seriously underweight
16–18 underweight
18–24 normal weight
24–29 overweight
29–35 seriously overweight
above 35 gravely overweight

Write a program that prompts the user to enter a weight in pounds and height in inches and
display the BMI. Note that one pound is 0.45359237 kilograms and one inch is 0.0254
meters.

Note: your program must accept input from the user such as name, section, and grades of every subject.
God Bless!!
Prepared by: Joynilenge C. Lavador

You might also like