chapter 3

Ace your homework & exams now with Quizwiz!

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

Which statement is equivalent to the following?number += 1;

number = number + 1;

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

overflows

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

setprecision

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

the data type of the variable

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

the data type of the variable

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

the header file iostream

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

type conversion

How many characters will the following statement read into the variable myString?cin >> setw(10) >> myString;

9

The ________ operator always follows the cin object, and the ________ operator follows the cout object.

>>,<<

What is TRUE about the following statement?cout << setw(4) << num4 << " ";

It allows four spaces for the value in num4.

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

getline

Which of the following statements will read an entire line of input into the string object, address?

getline(cin, address);

What is the value of average after the following code executes?double average;average = 1.0 + 2.0 + 3.0 / 3.0;

4.0

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();

Which of the following statements will allow the user to enter three values to be stored in variables length, width, and height, in that order?

cin.get(length, width, height);

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

EMERGENCY: Section 8 - Special Patient Populations (2 of 2)

View Set

COTA Exam Example Questions 1 (buy the book)

View Set

Microeconomics 2106 Homework Set #6

View Set

Chapter 6 and 14: without computations

View Set

Chemistry- Atom,Molecule, Element &compound,

View Set