Filters
Question type

Study Flashcards

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.

A) True
B) False

Correct Answer

verifed

verified

Which of the following statements will allow the user to enter three values to be stored in variables length, width, and height, in that order?


A) cin << length, width, height;
B) cin.get(height, width, length) ;
C) cin.get(length, width, height) ;
D) cin >> length; width; height;
E) cin.get(length >> width >> height) ;

F) D) and E)
G) B) and E)

Correct Answer

verifed

verified

What is the value of cube after the following code executes? Double cube, side; Side = 5.0; Cube = pow(side, 3.0) ;


A) 25.0
B) 15.0
C) 125.0
D) 8.0
E) unknown

F) C) and D)
G) A) and E)

Correct Answer

verifed

verified

C

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


A) type correction
B) type conversion
C) promotion
D) demotion
E) None of these

F) A) and E)
G) A) and C)

Correct Answer

verifed

verified

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


A) the smallest C++ data type
B) the largest C++ data type
C) the data type of the variable
D) the data type of the expression
E) None of these

F) A) and D)
G) C) and D)

Correct Answer

verifed

verified

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


A) number = pow(number, 2) ;
B) number *= 2;
C) number = number * number;
D) number * 2 = number;
E) None of these

F) A) and D)
G) All of the above

Correct Answer

verifed

verified

What is the value of x after the following code executes? Int x; X = 3 / static_cast<int>(4.5 + 6.4) ;


A) 0.3
B) 0
C) 0.275229
D) 3.3
E) None of these

F) B) and D)
G) C) and D)

Correct Answer

verifed

verified

When a user types values at the keyboard, those values are first stored


A) as ASCII characters
B) in the header file iostream
C) in the keyboard buffer
D) as integers
E) None of these

F) A) and C)
G) B) and E)

Correct Answer

verifed

verified

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


A) output stream
B) cin object
C) cout object
D) preprocessor
E) None of these

F) A) and B)
G) A) and E)

Correct Answer

verifed

verified

Which of the following functions tells the cin object to skip one or more characters in the keyboard buffer?


A) cin.ignore
B) cin.jump
C) cin.hop
D) cin.skip
E) None of these

F) A) and C)
G) B) and C)

Correct Answer

verifed

verified

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


A) underflows
B) overflows
C) reverses
D) converts
E) None of these

F) A) and C)
G) A) and E)

Correct Answer

verifed

verified

Associativity is either right to left or


A) top to bottom
B) front to back
C) left to right
D) undeterminable
E) None of these

F) All of the above
G) A) and E)

Correct Answer

verifed

verified

C

When the fixed manipulator is used, the value specified by the setprecision manipulator will be the number of digits to appear after the decimal point.

A) True
B) False

Correct Answer

verifed

verified

Arithmetic operators that share the same precedence have right to left associativity.

A) True
B) False

Correct Answer

verifed

verified

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


A) It allows four spaces for the value in num4.
B) It outputs "setw(4) " before the value in num4.
C) It is incorrect because it should use setw(10) .
D) It is incorrect because it should use setw(num4) .

E) A) and D)
F) B) and D)

Correct Answer

verifed

verified

Which statement is equivalent to the following? Number += 1;


A) number = number + 1;
B) number = 1;
C) number + 1;
D) number =+ 1;
E) None of these

F) D) and E)
G) B) and C)

Correct Answer

verifed

verified

Which of the following statements will read an entire line of input into the string object, address?


A) cin << address;
B) cin address;
C) cin.get(address) ;
D) getline(cin, address) ;
E) cin.get(length >> width >> height) ;

F) C) and D)
G) B) and C)

Correct Answer

verifed

verified

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


A) 3
B) 30
C) 39
D) 2
E) None of these

F) None of the above
G) C) and D)

Correct Answer

verifed

verified

C

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


A) 2.0
B) 3.0
C) 4.0
D) 2
E) unknown

F) D) and E)
G) A) and B)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 45

Related Exams

Show Answer