Filters
Question type

Study Flashcards

The following two C++ statements perform the same operation. wages = regPay + overTime; regPay + overTime = wages;

Correct Answer

verifed

verified

In programming terms, a group of characters inside a set of double quotation marks (" ") is called


A) a character literal.
B) a string literal.
C) a character set.
D) none of the above.
E) any of the above.

Correct Answer

verifed

verified

A variable must be defined


A) in every program.
B) and initialized at the same time.
C) in order to perform output.
D) before it can be used.
E) in all of the above cases.

Correct Answer

verifed

verified

The expression 7 / 2 evaluates to


A) 1
B) 3
C) 3.5
D) 7.2
E) 14

Correct Answer

verifed

verified

________ are data items whose values cannot change while the program is running.


A) Literals
B) Variables
C) Fixed data
D) Integers
E) None of the above

Correct Answer

verifed

verified

________ must be included in a program in order to use the cout object.


A) Opening and closing braces
B) The iostream header file
C) A cout declaration
D) Strings
E) None of the above

Correct Answer

verifed

verified

The following statements both declare the variable num to be an integer. int num; INT num;

Correct Answer

verifed

verified

Which of the following keywords is/are the names of C++ data types?


A) short
B) long
C) double
D) bool
E) All of the above

Correct Answer

verifed

verified

In a C++ program, two slash marks ( // ) indicate the beginning of


A) a block of code.
B) a comment.
C) a variable definition.
D) a program.
E) none of the above.

Correct Answer

verifed

verified

A ________ variable can hold only one of two values: True or false.


A) binary
B) single precision
C) T/F
D) char
E) bool

Correct Answer

verifed

verified

The following two statements could be used interchangeably in a C++ program. // Program Payroll /* Program Payroll */

Correct Answer

verifed

verified

A C++ character literal is enclosed in ______ quotation marks, whereas a string literal is enclosed in ______ quotation marks.


A) double, single
B) triple, double
C) open, closed
D) single, double
E) no, some

Correct Answer

verifed

verified

The ________ directive causes the contents of another file to be inserted into a program.


A) #getfile
B) #library
C) #insert
D) #include
E) None of the above

Correct Answer

verifed

verified

Which of the following will cause the next output to begin on a new line?


A) cout << endl;
B) cout << "endl";
C) cout << "/n";
D) All of the above
E) A and C, but not B

Correct Answer

verifed

verified

What literal(s) appear in the following C++ statement? Int number = 4 + 8;


A) number
B) 4
C) 8
D) 12
E) both B and C

Correct Answer

verifed

verified

C++ automatically places ________ at the end of a string literal.


A) a semicolon
B) quotation marks
C) the null terminator
D) a newline escape sequence
E) a blank

Correct Answer

verifed

verified

If a variable is defined as int sum; it may be written in the program code as sum or Sum, but not SUM.

Correct Answer

verifed

verified

An operation that copies a value into a variable is called a(n) ________ operation.


A) assignment
B) equals
C) copy
D) declaration
E) cout

Correct Answer

verifed

verified

If number is an int variable, both of the following statements will print out its value: cout << number; cout << "number";

Correct Answer

verifed

verified

What value will be assigned to the variable number by the following statement? Int number = 3.75;


A) 3
B) 4
C) 3.75
D) None of the above.
E) It's unpredictable. That's the problem.

Correct Answer

verifed

verified

Showing 21 - 40 of 40

Related Exams

Show Answer