CMSY 141 - Chapter 3

Ace your homework & exams now with Quizwiz!

The ________ operator follows the cout object

<<

A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the value of each variable at each step is known as

hand tracing

Which of the following must be included in any program that uses the cin object?

iostream

When a user types values at the keyboard, those values are first stored

keyboard buffer

This manipulator causes the field to be left justified with padding spaces printed to the right

left

Associativity is either right to left or

left to right

When a variable is assigned a number that is too large for its data type, it

overflows

Which of the following functions will return the value of x, rounded to the nearest whole number?

round(x)

You can control the number of significant digits in your output with the ________ manipulator

setprecision

This manipulator is used to establish a field width for the value that follows it

setw

When C++ is working with an operator, it strives to convert operands to the same type. This is known as

type coercion

The ________ operator always follows the cin object

>>

Arithmetic operators that share the same precedence have right to left associativity.

False

If you want to know the length of the string that is stored in a string object, you can call the object's size member function.

False

In C++, it is impossible to display the number 34.789 in a field of 9 spaces with 2 decimal places of precision.

False

The fixed manipulator causes a number to be displayed in scientific notation.

False

The following statement will output $5.00 to the screen: cout << setprecision(5) << dollars << endl;

False

When a program uses the setw manipulator, the iosetwidth header file must be included in a preprocessor directive.

False

To use the rand()function, you must include the ________ header file?

cstdlib

When the final value of an expression is assigned to a variable, it will be converted to the variables

data type

This manipulator forces cout to print digits in fixed-point notation

fixed

The cin >> statement will stop reading input when it encounters a newline character.

True

The only difference between the get function and the >> operator is that get reads the first character typed, even if it is a space, tab, or the [Enter] key.

True

When C++ is working with an operator, it strives to convert the operands to the same type.

True

When the fixed manipulator is used, the value specified by the setprecision manipulator will be the number of digits to appear after the decimal point.

True

The ________ causes a program to wait until information is typed at the keyboard and the [Enter] key is pressed.

cin object

Which of the following statements will pause the screen until the [Enter] key is pressed?

cin.get()

________ reads a line of input, including leading and embedded spaces, and stores it in a string object.

cin.getline()

Which of the following functions tells the cin object to skip one or more characters in the keyboard buffer?

cin.ignore()

The function pow(x, y), requires which header file?

cmath


Related study sets

Chapter 11 Pain Management Prep U 40 questions

View Set

Count 1 to 10 in 25 Languages up to Polish

View Set

Lecture 3 - Self-affirmation theory

View Set