Chapter Three

¡Supera tus tareas y exámenes ahora con Quizwiz!

0

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

2

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

True

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

4.0

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

-3

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;

iostream header file

In any program that uses the cin object, you must include the ___________.

3 * 2

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

cin object

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

cmath

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

cin.ignore

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

setw

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

cstdlib

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

parentheses

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

+

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

cmath

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

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

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

6

Which line in the following program will cause a compiler error? 1 #include <iostream> 2 using namespace std; 3 4 int main( ) 5 { 6 const int MY_VAL; 7 MY_VAL = 77; 8 cout << MY_VAL << endl; 9 return 0; 10 }

x *= 2;

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

cin >> length >> width >> height;

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

left to right

Associativity is either right to left or:


Conjuntos de estudio relacionados

Purchasing and Buyer Behavior Exam 3 Review: Ch.10-14 Testbank

View Set

Public Speaking Final Chpts 14-26

View Set

practice questions- ch 22&26 - GI/GU Dysfunction

View Set

Practical Questions - Math Part 1-10

View Set

Chapter 10, 11, 12 Criminal Courts

View Set

Chapter 2: Software and Software Engineering

View Set

Vocabulary Workshop Level E Unit 4 (Definitions)

View Set