Quiz 3 Flashcards
The ________ causes a program to wait until information is typed at the keyboard and the Enter key is pressed.
A) Output stream
*B) cin object
C) cout object
D) Preprocessor
E) None of the above
The ________ operator always follows the cin object, and the ________ operator follows the cout object.
A) binary, unary
B) conditional, binary
*C)»_space;, «
D) <>
E) None of the above
________ reads a line of input, including leading and embedded spaces, and stores it in a string object.
A) cin.get
*B) getline
C) cin.getline
D) get
E) None of these
When this operator is used with string operands it concatenates them, or joins them together.
A) &
B) *
C) %
*D) +
E) None of the above
What is the value stored at x, given the statements:
int x; x = 3 / static_cast(4.5 + 6.4);
A) .3
*B) 0
C) .275229
D) 3.3
E) None of these
fix
*A) cin.ignore
B) cin.jump
C) cin.hop
D) cin.skip;
E) None of the above
The function, pow(x, 5.0), requires this header file.
A) cstdlib
*B) cmath
C) cstring
D) iostream
E) iomanip
You can use these to override the rules of operator precedence in a mathematical expression.
A) [Brackets]
*B) (Parentheses)
C) {Braces}
D) The escape character \
E) None of these
When the final value of an expression is assigned to a variable, it will be converted to:
A) The smallest C++ data type
B) The largest C++ data type
*C) The data type of the variable
D) The data type of the expression
E) None of the above
When a variable is assigned a number that is too large for its data type, it:
A) underflows
*B) overflows
C) reverses polarity
D) exceeds expectations
E) None of the above
This manipulator is used to establish a field width for the value immediately following it.
A) field_width
B) set_field
*C) setw
D) iomanip
E) None of the above
This manipulator causes the field to be left-justified with padding spaces printed to the right.
A) left_justify
B) right
*C) left
D) left_pad
E) None of these
This statement will pause the screen, until the [Enter] key is pressed.
Group of answer choices
A) cin;
B) cin.getline();
*C) cin.get();
D) cin.ignore();
E) cin.input();
To use the rand() function, you must #include this header file in your program.
Group of answer choices
A) iostream
B) iomanip
C) iorand
*D) cstdlib
E) None of these
Assume that x is an int variable. What value is assigned to x after the following assignment statement is executed?
x = -3 + 4 % 6 / 5;
A) 0
B) 1
C) 2
*D) —3
E) None of these