Programming Ch. 3 Quiz

Ace your homework & exams now with Quizwiz!

Which is true about the following statement? cout << setw(4) << num4 << " ";

It allows four spaces for the value in the variable num4.

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

cin >> length >> width >> height;

If you want to stop the screen, until your press "Enter", you can use one of the following statements.

cin.get();

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

What will the value of result be after the following statement executes? result = 6 - 3 * 2 + 7 - 10 / 2 ;

2

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;

-3

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

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

false


Related study sets

Nervous system medical terminology

View Set

review of concepts summary slides for exam

View Set

Messina Final Exam Review Questions and Answers CP

View Set

Informationssicherheit Secure Messaging

View Set