Filters
Question type

Study Flashcards

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

Correct Answer

verifed

verified

#include <iostream> is an example of a(n)


A) comment.
B) compiler option.
C) preprocessor directive.
D) I/O statement.
E) stream directive.

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

A _ is used to mark the end of a complete C++ programming statement.


A) closing brace
B) new line
C) period
D) semicolon
E) comment

Correct Answer

verifed

verified

An escape sequence must start with a forward slash (/).

Correct Answer

verifed

verified

The expression 7 / 2 evaluates to


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

Correct Answer

verifed

verified

Which of the following is/are valid C++ identifiers?


A) department_9
B) aVeryLongVariableName
C) last-name
D) All of the above are valid identifiers.
E) Both A and B are valid identifiers, but C is not.

Correct Answer

verifed

verified

The following two statements both assign the value 5 to the variable dept. 5 = dept; dept = 5;

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

The bool data type


A) has only two values: true and false.
B) can be used to store a single character.
C) is used to store extra large numbers.
D) is used to represent numbers in E notation.
E) does none of the above.

Correct Answer

verifed

verified

Every C++ program must have


A) variables.
B) literals.
C) comments.
D) a function called main..
E) all of the above.

Correct Answer

verifed

verified

C++ is a case- sensitive language.

Correct Answer

verifed

verified

You must have a(n) for every variable you include in a program.


A) numeric value
B) output statement
C) comment
D) purpose
E) definition

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

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


A) Strings
B) A cout declaration
C) Opening and closing braces
D) The iostream header file
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

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


A) a character literal.
B) a string constant.
C) a string literal.
D) all of the above.
E) either B or C, but not A.

Correct Answer

verifed

verified

The expression 7 % 2 evaluates to


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

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

Showing 21 - 40 of 40

Related Exams

Show Answer