Академический Документы
Профессиональный Документы
Культура Документы
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
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. (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.
(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