Name:     ID: 
 
Email: 

Adven08 Lesson 3 Test A

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 1. 

Which C++ operator is used to determine the integer remainder value of a division operation?
a.
balance
c.
left
b.
remainder
d.
modulus
 

 2. 

Which statement below could be used in a C++ program to display a message and the result of a calculation to the user without requiring a variable to store the result?
a.
cout << "Result = x/y" << endl;
c.
cout << "Result = " x/y << endl;
b.
cout << "result = x/y endl; <<
d.
cout << "Result = " << x/y << endl;
 

 3. 

Which of the following symbols represents the C++ assignment operator?
a.
=
c.
<-
b.
->
d.
= =
 

 4. 

For the expression: x = 13 % 5; What would be the result stored in x
a.
2
c.
3
b.
9,826,809
d.
65
 

 5. 

While most arithmetic operators are always used with two operands, which operator below can also be used with a single operand?
a.
-
c.
^
b.
*
d.
%
 

 6. 

Which of the following items has the highest order of operations?
a.
multiplication
c.
negation
b.
division
d.
addition
 

 7. 

Which term below describes the C++ operators used to perform calculations in a program?
a.
arithmetic
c.
mathematical
b.
logical
d.
all of the above
 

 8. 

What will occur to the value in the variable count when the instruction count++; is executed?
a.
the value will have its sign changed
c.
the value will be raised to a power of 2
b.
the value will be increased by one
d.
the value will be doubled
 

 9. 

Which of the following statements could be used in a C++ program to initialize three variables to the same value in one statement?
a.
i j k = 25;
c.
i = j = k = 25;
b.
i, j, k = 25;
d.
none of the above
 

True/False
Indicate whether the statement is true or false.
 

 10. 

The C++ assignment operator functions the same way the equal sign functions in algebra.
 

 11. 

The C++ initialization operator changes the value of the variable to the left of the operator.
 

 12. 

C++ allows variables of different data types to be initialized in a single program statement.
 

 13. 

Including arithmetic operations in output statements can save memory and result in fewer programming statements being written.
 

 14. 

The C++ division operator symbol is the backward slash (\).
 

 15. 

The minus sign (-) can be used to change the sign of a variable or value.
 

 16. 

You should not include calculations in output statements if you will need to access or process the result of the calculation later in the program.
 

 17. 

Parentheses can be used in an expression to change the order of operations.
 

 18. 

Programs that will perform divide operations do not need to include code to check for division by zero since it is always trapped and corrected by the compiler.
 

 19. 

In the statement, x = --y; the value assigned to x will be one less than the current value of y.
 

 20. 

The assignment operator can be used in a variable declaration statement to declare and initialize the variable in one statement.
 



 
         Start Over