1.
A function that is associated with an object is called a _________ function.
A. 
B. 
C. 
D. 
2.
What is the output of the following function and function call?
void calculateCost(int count, float& subTotal, float taxCost);
float tax = 0.0,
subtotal = 0.0;
calculateCost(15, subtotal,tax);
cout << "The cost for 15 items is " << subtotal
<< ", and the tax for " << subtotal << " is " << tax << endl;
//end of fragment
void calculateCost(int count, float& subTotal, float taxCost)
{
if ( count < 10)
{
subTotal = count * 0.50;
}
else
{
subTotal = count * 0.20;
}
taxCost = 0.1 * subTotal;
}
A. 
The cost for 15 items is 3.00, and the tax for 3.00 is 0.30;
B. 
The cost for 15 items is 0.00, and the tax for 3.00 is 0.00;
C. 
The cost for 15 items is 0.00, and the tax for 3.00 is 0.30;
D. 
The cost for 15 items is 3.00, and the tax for 3.00 is 0.00;
3.
What is the value of x after the following statements?
int x, y, z;
y = 10;
z = 3;
x = y * z + 3;
A. 
B. 
C. 
D. 
4.
What is the value of x after the following statements?
int x;
x = x + 30;
A. 
B. 
C. 
D. 
5.
What is the output of the following code?
float value;
value = 33.5;
cout << value << endl;
A. 
B. 
C. 
D. 
6.
Which of the following statements is NOT legal?
A. 
B. 
C. 
D. 
7.
What is the value of choice after the following statements?
void getChoice(int& par_choice, in par_count);
int choice, count=3;
getChoice(choice, count);
void getChoice(int& par_choice, in par_count)
{
if(par_count<0)
par_choice =0;
if(par_count = 0)
par_choice=-1;
else
par_choice=99;
return;
}
A. 
B. 
C. 
D. 
8.
Which of the following is not an example of a program bug?
A. 
B. 
C. 
D. 
9.
The set of instructions that a computer will follow is known as:
A. 
B. 
C. 
D. 
10.
Which of the following is not a valid identifier?
A. 
B. 
C. 
D. 
11.
Which of the following is not part of the Software Life Cycle?
A. 
B. 
C. 
D. 
E. 
12.
An algorithm is
A. 
The inputs and outputs of a program
B. 
The part of the computer that does the processing
C. 
A finite set of steps to solve a problem
D. 
A complete computer program
13.
Which of the following is not a phase of the program-design process?
A. 
B. 
C. 
Marketing the final program
14.
What is the value of x after the following statements?
double x;
x = 0;
x += 3.0 * 4.0;
x -= 2.0;
A. 
B. 
C. 
D. 
15.
What is the value of x after the following statements?
int x;
x = 15 %4;
A. 
B. 
C. 
D. 
16.
What is the value of x after the following statement?
float x;
x = 3.0 / 4.0 + 3 + 2 / 5
A. 
B. 
C. 
D. 
17.
-
Which boolean operation is described by the following table?
A
B
Operation
True
True
True
True
False
True
False
True
True
False
False
False
A. 
B. 
C. 
D. 
18.
Which of the following data types may be used in a switch statement?
A. 
B. 
C. 
D. 
E. 
F. 
19.
What is wrong with the following for loop?
for(int i=0; i<10; i--)
{
cout << "Hello\n";
}
A. 
Can not use a for-loop for this
B. 
C. 
D. 
20.
What is the value of x after the following code fragment executes?
float x = 36.0;
x = sqrt(x);
A. 
B. 
C. 
D. 
21.
What is the output of the following program fragment?
cout << pow(4,2) << endl;
A. 
B. 
C. 
D. 
22.
-
Which boolean operation is described by the following table?
A
B
Operation
True
True
True
True
False
False
False
True
False
False
False
False
A. 
B. 
C. 
D. 
23.
If the variable x has the original value of 3.4, what is the value in x after the following?
cout << static_cast(x);
A. 
B. 
C. 
D. 
24.
What is the value of the following?
sqrt(sqrt(pow(2,4)));
A. 
B. 
C. 
D. 
25.
What is the value of i after the following function call?
//function definition
int doSomething(int value)
{
value = 35;
return value;
value = 13
}
//fragment of main program
int i=0;
cout << doSomething(i);
A. 
B. 
C. 
D.