C++ Programming Ch.3

Ace your homework & exams now with Quizwiz!

This function tells the cin object to skip one or more characters in the keyboard buffer.

cin.ignore

The function, pow(x, 5.0), requires this header file.

cmath

When using the sqrt function you must include this header file.

cmath

To use the rand() function, you must #include this header file in your program.

cstdlib

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

fixed

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

getline

Associativity is either right to left or

left to right

The statement cin >> setw(10) >> str; Will read up to this many characters into str.

nine

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

overflows

When converting some algebraic expressions to C++, you may need to insert ___ that do not appear in the algebraic expression.

parenthesis

You can use these to override the rules of operator precedence in a mathematical expression.

(parentheses)

When this operator is used with string operands it concatenates them, or joins them together?

+

Assume that x an int variable. What value is assigned to x after the following assignment statement is executed? X = -3 + 4 % 6 / 5

-3

What is the value stored at x, given the statements: int x; x = 3/static_cast<int>( 4.5 + 6.4);

0

What will the value of x be after the following statements execute? Int x = 0; Int y = 5; Int z = 4; X = y + z * 2;

13

What is the value of number after the following statements execute? Int number = 10; number +=5; number -=2; number *=3;

15

In the following C++ statement, what will be executed first according to the order of the precedence? result = 6-3*2+7-10/2;

3 * 2

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

4.0

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

Left

Which statement is equivalent to the following? x = x * 2

x*=2;

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

>>, <<

The ____ causes a program to wait until information is typed at the keyboard and the enter key is pressed.

Cin object

You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?

Cin.get (length, width, height);

This statement will pause the screen, until the [enter] key is pressed.

Cin.get();

Which statement will read an entire line of input into the following string object?

Getline (cin, address);

In any program that uses the cin object, you much include the ______.

Iostream header file

This manipulator is used to establish a field width for the value immediately following it.

Setw

The total number of digits that appear before and after the decimal point is sometimes referred to as:

Significant digits and percision

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

The data type of the variable


Related study sets

MARK3336 Ch. 7 Video: Atlanta Hawks Arena Is Geared Toward Digital Experience

View Set

Comptia Network+ 1.0 Networking Fundamentals

View Set

Finance 342 Chapter 8 Concept Questions

View Set