Name:     ID: 
 
Email: 

Adventures 3

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

 1. 

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

 2. 

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

 3. 

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

 4. 

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

 5. 

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

 6. 

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.
 

 7. 

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

 8. 

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

 9. 

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

 10. 

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

 11. 

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.
 

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

 12. 

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

 13. 

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
 

 14. 

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

 15. 

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

 16. 

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

 17. 

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;
 

 18. 

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

 19. 

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 increased by one
b.
the value will be raised to a power of 2
d.
the value will be doubled
 

 20. 

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.
^
 



 
         Start Over