Exam 3: Expressions and Interactivity

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

This manipulator forces cout to print digits in fixed-point notation:

(Multiple Choice)
4.9/5
(30)

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

(Multiple Choice)
4.8/5
(38)

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

(True/False)
4.7/5
(29)

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

(True/False)
4.9/5
(33)

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

(Multiple Choice)
4.7/5
(39)

A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the value of each variable at each step is known as

(Multiple Choice)
4.8/5
(35)

What is the value of x after the following code executes? Int x = 0; Int y = 5; Int z = 4; X = x + y + z * 2;

(Multiple Choice)
4.9/5
(29)

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.

(True/False)
4.8/5
(29)

What will be displayed after the following statements execute? int num1 = 5; int num2 = 3; cout << "The result is " << (num1 * num2 + 10) << endl;

(Multiple Choice)
4.9/5
(36)

Which of the following statements will pause the screen until the [Enter] key is pressed?

(Multiple Choice)
4.8/5
(29)

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

(True/False)
4.8/5
(34)

Which of the following will allow the user to input the values 15 and 20 and have them stored in variables named base and height, respectively?

(Multiple Choice)
4.9/5
(35)

Which of the following functions will return the value of x, rounded to the nearest whole number?

(Multiple Choice)
4.9/5
(37)

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

(True/False)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(31)

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

(Multiple Choice)
4.8/5
(28)

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

(True/False)
4.8/5
(31)

To use the rand()function, you must include the __________ header file?

(Multiple Choice)
4.9/5
(28)

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

(Multiple Choice)
5.0/5
(42)

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

(Multiple Choice)
4.8/5
(29)
Showing 21 - 40 of 45
close modal

Filters

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