Deck 1: P A C++ Primer
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 1: P A C++ Primer
1
A C++ program is __________ into a form that is directly executed by the computer.
compiled
2
A __________ is a general description of a group of entities that all have the same characteristics-that is, they can all perform or undergo the same kinds of actions, and the same pieces of information are meaningful for all of them.
A) function
B) class
C) method
D) member
A) function
B) class
C) method
D) member
class
3
The line int main () identifies the place where the operating system begins the execution of a program.
True
4
If you place a(n) __________ before a macro parameter, then the preprocessor replaces it with a string literal of the corresponding argument.
A) %
B) &
C) #
D) *
A) %
B) &
C) #
D) *
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
The# include directive has one of two forms: #include <header> and __________.
A)# include file-name
B)# include "file-name"
C)# include "file-name".
D)# inc "file-name"
A)# include file-name
B)# include "file-name"
C)# include "file-name".
D)# inc "file-name"
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
If num = 1 when the condition (num != 0 && sum / num) is tested, the expression after && is not evaluated.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
Which value of n will cause the condition (n >0 && n < 10) to evaluate to true?
A) 0
B) 1
C) 10
D) 11
A) 0
B) 1
C) 10
D) 11
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
The following code segment should include the __________ statement at the end of each case to cause proper exit of control.
switch (operator) {
case '+':
result = x + y;
add_op++;
/* missing statement */
case '/':
result = x / y;
divide_op++;
/* missing statement */
default: ;
}
switch (operator) {
case '+':
result = x + y;
add_op++;
/* missing statement */
case '/':
result = x / y;
divide_op++;
/* missing statement */
default: ;
}
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
C++ uses type __________ to represent logical data.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
In operations involving mixed-type operands, the numeric type of the smaller range is converted to the numeric type of the larger range.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
Objects that are declared outside the scope of a function or class are called __________ objects.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
In C++, function parameters are either call-by-value or call-by-__________.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
The notation for applying a member function to an object is called dot notation.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
In C++, an array is also an object.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
You can use either students[0] or __________ to reference the first element of an array named students.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
To delete a dynamically allocated array named students, use the statement __________ students.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
In C++, a string literal is stored internally as an array of constant __________.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
Assume you have declared:
Int [4][5] an_Array;
You would assign 8 to the last array component with the statement __________.
A) an_Array[3][4] = 8;
B) an_Array[3][5] = 8;
C) an_Array[4][4] = 8;
D) an_Array[4][5] = 8;
Int [4][5] an_Array;
You would assign 8 to the last array component with the statement __________.
A) an_Array[3][4] = 8;
B) an_Array[3][5] = 8;
C) an_Array[4][4] = 8;
D) an_Array[4][5] = 8;
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
The function substr returns a new __________ containing a portion of the string object to which it is applied.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Beginnings and ends of tokens are marked by characters, referred to as __________, that cannot be part of the tokens they separate.
A) flags
B) markers
C) boundaries
D) delimiters
A) flags
B) markers
C) boundaries
D) delimiters
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
An output __________ is a sequence of characters representing program output.
A) array
B) stream
C) class
D) function
A) array
B) stream
C) class
D) function
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
The function __________ indicates whether the end of the input file was reached during the last extraction operation.
A) fail ()
B) bad ()
C) eof ()
D) operator! ()
A) fail ()
B) bad ()
C) eof ()
D) operator! ()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
The class ostream defines the __________ operator (<<) for the primitive types.
A) extraction
B) insertion
C) retrieval
D) buffer
A) extraction
B) insertion
C) retrieval
D) buffer
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
In C++, the __________ format is the default floating-point format.
A) scientific
B) precision
C) general
D) fixed
A) scientific
B) precision
C) general
D) fixed
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
By default, ifstreams have the "in flag" set, ofstreams have the "out flag" set, and __________ have both in and out set.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck