Filters
Question type

Study Flashcards

Assume that x is an int variable. What value is assigned to x after the following assignment statement is executed? Assume that x is an int variable. What value is assigned to x after the following assignment statement is executed?   A) 0 B) 1 C) 2 D) -3 E) None of these


A) 0
B) 1
C) 2
D) -3
E) None of these

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

Correct Answer

verifed

verified

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


A) setprecision(2)
B) setw(2)
C) fixed
D) setfixed(2)
E) None of these

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

Correct Answer

verifed

verified

Which is true about the following statement? Which is true about the following statement?   A) It allows four spaces for the value in the variable num4. B) It outputs  setw(4)   before the value in the variable num4. C) It should use setw(10) to output the value in the variable num10. D) It inputs up to four characters stored in the variable num4. E) None of these


A) It allows four spaces for the value in the variable num4.
B) It outputs "setw(4) " before the value in the variable num4.
C) It should use setw(10) to output the value in the variable num10.
D) It inputs up to four characters stored in the variable num4.
E) None of these

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

Correct Answer

verifed

verified

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

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

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

A) True
B) False

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

Which line in the following program will cause a compiler error? Which line in the following program will cause a compiler error?   A) 6 B) 8 C) 9 D) 7


A) 6
B) 8
C) 9
D) 7

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

Correct Answer

verifed

verified

Which line in the following program will cause a compiler error? Which line in the following program will cause a compiler error?   A) 6 B) 8 C) 9 D) 7


A) 6
B) 8
C) 9
D) 7

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

Correct Answer

verifed

verified

This function 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 the above

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

Correct Answer

verifed

verified

What is the value of average after the following code executes? What is the value of average after the following code executes?   A) 2.0 B) 4.0 C) 1.5 D) 6.0


A) 2.0
B) 4.0
C) 1.5
D) 6.0

E) All of the above
F) B) and D)

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 the above

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

Correct Answer

verifed

verified

What will the value of x be after the following statements execute? What will the value of x be after the following statements execute?   A) 13 B) 18 C) 0 D) unknown


A) 13
B) 18
C) 0
D) unknown

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

Correct Answer

verifed

verified

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


A) [Brackets]
B) (Parentheses)
C) {Braces}
D) The escape character \
E) None of these

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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


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

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

This manipulator causes the field to be left-justified with padding spaces printed to the right.


A) left_justify
B) right
C) left
D) left_pad
E) None of these

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

Correct Answer

verifed

verified

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


A) Parentheses
B) Exponents
C) Calculations
D) Coercions
E) None of the above

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

Correct Answer

verifed

verified

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


A) binary, unary
B) conditional, binary
C) >>, <<
D) <<, >>
E) None of the above

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

Correct Answer

verifed

verified

Showing 21 - 40 of 44

Related Exams

Show Answer