Filters
Question type

Study Flashcards

Of the following, which is a valid C++ identifier?


A) June1997
B) _employee_number
C) ___department
D) myExtraLongVariableName
E) All of the above are valid identifiers.

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

Correct Answer

verifed

verified

Besides decimal, two other number systems you might encounter in C++ programs are:


A) Octal and Fractal
B) Hexadecimal and Octal
C) Unary and Quaternary
D) Base 7 and Base 9
E) None of the above

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

Correct Answer

verifed

verified

Assume that a program has the following string object definition: string name; Which of the following statements correctly assigns a string literal to the string object?


A) name = Jane;
B) name = "Jane";
C) name = 'Jane';
D) name = (Jane) ;

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

Correct Answer

verifed

verified

What will the following code display? int x = 0, y = 1, z = 2; Cout << x << y << z << endl;


A) 0 1 2
B) 0
1
2
C) xyz
D) 012

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

Correct Answer

verifed

verified

This control sequence is used to skip over to the next horizontal tab stop.


A) \n
B) \h
C) \t
D) \a
E) \'

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

Correct Answer

verifed

verified

A preprocessor directive does not require a semicolon at the end.

A) True
B) False

Correct Answer

verifed

verified

What will the following code display? cout << "Four " << "score "; cout << "and " << "seven/n"; cout << "years" << "ago" << endl;


A) Four score and seven
Yearsago
B) Four score and seven
Years ago
C) Four score and seven/nyearsago
D) Four
Score
And
Seven
Yearsago

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

Correct Answer

verifed

verified

The C++ language requires that you give variables names that indicate what the variables are used for.

A) True
B) False

Correct Answer

verifed

verified

When typing in your source code into the computer, you must be very careful since most of your C++ instructions, header files, and variable names are case sensitive.

A) True
B) False

Correct Answer

verifed

verified

What is the modulus operator?


A) +
B) *
C) &
D) %
E) ||

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

Correct Answer

verifed

verified

What will the following code display? int number = 7; Cout << "The number is " << "number" << endl;


A) The number is 7
B) The number is number
C) The number is7
D) The number is 0

E) All of the above
F) None of the above

Correct Answer

verifed

verified

C++ does not have a built in data type for storing strings of characters.

A) True
B) False

Correct Answer

verifed

verified

These are used to declare variables that can hold real numbers.


A) Integer data types
B) Real data types
C) Floating point data types
D) Long data types
E) None of the above

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

Correct Answer

verifed

verified

You must have a ___________ for every variable you intend to use in a program.


A) purpose
B) definition
C) comment
D) constant
E) None of the above

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

Correct Answer

verifed

verified

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


A) Pound Sign
B) Semicolon
C) Data type
D) Void
E) None of the above

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

Correct Answer

verifed

verified

Which of the following defines a double-precision floating point variable named payCheck?


A) float payCheck;
B) double payCheck;
C) payCheck double;
D) Double payCheck;

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

Correct Answer

verifed

verified

Escape sequences are always stored internally as a single character.

A) True
B) False

Correct Answer

verifed

verified

The ______ is/are used to display information on the computer's screen.


A) Opening and closing braces
B) Opening and closing quotation marks
C) cout object
D) Backslash
E) None of the above

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

Correct Answer

verifed

verified

Assuming you are using a system with 1-byte characters, how many bytes of memory will the following string literal occupy? "William"


A) 7
B) 14
C) 8
D) 1

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

Correct Answer

verifed

verified

Which escape sequence causes the cursor to move to the beginning of the current line?


A) \n
B) \t
C) \a
D) \b
E) \r

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

Correct Answer

verifed

verified

Showing 21 - 40 of 56

Related Exams

Show Answer