Вы находитесь на странице: 1из 6

Adamson University Computer Engineering Department

College of Engineering Computer Fundamentals and Programming

MIDTERM - Quiz No.


Name: Date: Score:

Schedule: Instructor:

GENERAL DIRECTIONS: NO ERASURES. ALL FINAL ANSWERS SHOULD BE WRITTEN USING A NON-
ERASABLE PEN.

I. Understanding Variables. Determine whether the following variable names are acceptable or
not. Write “A” for acceptable and “NA” for not acceptable.

a. percent
b. Five5_five5
c. double
d. _1990_tax
e. number1

II. Understanding Operators.


A. To what value does each of the following expressions evaluate? Show your complete
solution. Box your final answer.

a. ((1 + -2) * 50 % 9)

b. 50 + (2 * (-1*(10 + 4)))

c. (5 != 5)

d. 10 % 3 * 3 – (1 + 10)

e. (10 + 2 * 3 / 2 )

cpedept.yda
Adamson University Computer Engineering Department
College of Engineering Computer Fundamentals and Programming

B. If x = 4, y = 6 and z = 2, determine whether each of the following evaluates true or false.


Show your solution. Write “T” for true and “F” for false. Box your final answer.

a. (z ==1) || (z++ < x)

b. (5==z) || (y-x == 2)

c. !(x == 4)

d. x != (y – z)

e. !((2*y–x ==z)&&(y==x+z))

III. Understanding Structure of a C++ program. Identify the different parts of the given C++
program. Choose your answer from the given choices below. Write the letter of the correct answer
on the table provided.

CHOICES: A. Get Character Function B. Comment


C. C++ Input Statement D. Clear Screen Function
E. Return Statement F. Preprocessor Directives
G. Main Function H. Expression
I. Variable Declaration J. C++ Output Statement

(1)
// this solves the area of a circle
#include<iostream.h> (2) 1.
#include<conio.h> 2.
#include<math.h> 3.
int main( ) 4.
(3)
5.
{
(4) 6.
int a, b, sum, x; 7.
clrscr( ); (5) 8.
cout<<”Enter two numbers: ”; 9.
cin>>a >> b; (6) 10.
sum = a+b; (7)
(8)
cout<<”\nThe sum of” << x << “and” << y << “is” << sum;
getch( ); (9)
return 0; (10)
}

cpedept.yda
Adamson University Computer Engineering Department
College of Engineering Computer Fundamentals and Programming

cpedept.yda
Adamson University Computer Engineering Department
College of Engineering Computer Fundamentals and Programming

cpedept.yda
Adamson University Computer Engineering Department
College of Engineering Computer Fundamentals and Programming

cpedept.yda
Adamson University Computer Engineering Department
College of Engineering Computer Fundamentals and Programming

cpedept.yda

Вам также может понравиться