Exam 3: Expressions and Interactivity

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

A

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

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

B

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

Free
(Multiple Choice)
4.7/5
(39)
Correct Answer:
Verified

B

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

(Multiple Choice)
4.9/5
(39)

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

(Multiple Choice)
4.8/5
(30)

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

(Multiple Choice)
4.7/5
(28)

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

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.8/5
(34)

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

(Multiple Choice)
5.0/5
(41)

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

(True/False)
4.8/5
(36)

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

(Multiple Choice)
4.8/5
(38)

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

(True/False)
4.9/5
(41)

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

(True/False)
4.7/5
(42)

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/False)
4.9/5
(38)

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;

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.8/5
(35)

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

(True/False)
4.9/5
(38)

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

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
5.0/5
(36)

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

(True/False)
4.9/5
(36)
Showing 1 - 20 of 44
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)