1. The ________ object causes data to be output to the monitor.
A. cin
B. cout
C. conditional
D. standard output
E. None of the above


2. True/False: The cin object will let the user enter a string larger than the array can hold.
A. True
B. False


3. Which of the following will read a string into the array char Names[20] ?
A. cin << Names;
B. cin Names;
C. cin >> Names[20];
D. cin >> Names;
E. None of the above


4. True/False: A string is stored in an array of characters.
A. True
B. False


5. Which of the following lines of code declares an array that will hold 49 characters and the null terminator?
A. char [49];
B. char string1[50];
C. char[50] string1;
D. character string[50];
E. None of the above


6. Associativity is either right to left or
A. Top to bottom
B. Front to back
C. Left to right
D. Undeterminable
E. None of the above


7. True/False: Arithmetic operators that share the same precedence have right to left associativity.
A. True
B. False


8. When converting some algebraic expressions to C++, you may need to insert ___________ that do not appear in the algebraic expression.
A. Parentheses
B. Exponents
C. Calculations
D. Coercions
E. None of the above


9. True/False: When C++ is working with an operator, it strives to convert the operands to the same type.
A. True
B. False


10. True/False: When a program uses the setw manipulator, the iosetwidth.h manipulator must be included in a preprocessor directive.
A. True
B. False


11. The statement cout << setw(4) << Num4 << " ";
A. Allows four spaces for the value in the variable Num4
B. Outputs "setw(4)" before the value in the variable Num4
C. Would use setw(10) to output the value in the variable Num10
D. Inputs up to four characters stored in the variable Num4
E. None of these


12. The total number of digits that appear before and after the decimal point is sometimes referred to as:
A. floating points
B. significant digits
C. precision
D. b and c
E. None of these


13. True/False: The statement cout << setprecision(5) << Dollars << endl; will output $5.00 to the monitor.
A. True
B. False


14. The stream manipulator, ____________, forces cout to print the digits in fixed-point notation.
A. setprecision(2)
B. setw(2)
C. setiosflags(ios::fixed)
D. setfixed(2)
E. None of these


15. The format flag, _________, causes the E in scientific notation numbers, and the X in hexadecimal numbers, to be displayed in upper case.
A. ios::hex
B. ios::showbig
C. ios::right
D. ios::uppercase
E. None of these


16. True/False: The ios::showpos format flag causes a + sign to be displayed in front of a positive number.
A. True
B. False


17. Output field width, precision, and format flags may be modified using stream manipulators or by _______________.
A. embedded scripting language statements
B. scientific notation
C. member functions of the cout object
D. ios::set() statements
E. None of these


18. True/False: In C++, it is impossible to display the number 34.789 in a field of 9 spaces with 2 decimal places of precision.
A. True
B. False


19. The statement cin.width(10); will read ______ characters.
A. Nine
B. Ten
C. Eleven
D. Eight
E. None of these



This is the end of the test. When you have completed all the questions and reviewed your answers, press the button below to grade the test. (this feature has been disabled).