When accessing a structure member, the identifier to the left of the dot operator is the name of
A. a structure member
B. a structure tag
C. a structure variable
D. the keyword struct
Select an option to see the answer and solution.
Assume that a program contains a programmer-defined void function. When C++ encounters the function's closing brace (}), C++ returns to the statement _____
A. immediately above the statement that called the function
B. that called the function
C. immediately below the statement that called the function
D. None of the above
Select an option to see the answer and solution.
Inheritance occurs when a class adopts all the traits of _________
A. an object
B. a parent class
C. a variable
D. a function
Select an option to see the answer and solution.
Template classes that have already been written to perform common class tasks are called _____
A. container classes
B. receptacle classes
C. repository classes
D. alembic classes
Select an option to see the answer and solution.
A _____ is a single item of information about a person, place, or thing
A. data file
B. field
C. program file
D. record
Select an option to see the answer and solution.
Which (if any) of the following is NOT a programmer-defined type
A. an array
B. a structure
C. a class
D. All of the above are programmer-defined types
Select an option to see the answer and solution.
Assume a program contains a void function named displayName, which requires no formal parameters. Which of the following is a correct function prototype for this function?
A. displayName;
B. displayName(void);
C. void displayName;
D. void displayName();
E. void displayName(none);
Select an option to see the answer and solution.
A file pointer always contains the address of the file
Select an option to see the answer and solution.
You declare a function with a function _____, which is typically entered at the beginning of the program, below the #include directives
A. call
B. prototype declaration
C. definition
D. pointer
Select an option to see the answer and solution.
The function whose prototype is Item getData(void); returns _____
A. the address of a structure
B. a copy of a structure
C. a pointer to a structure
D. nothing
Select an option to see the answer and solution.
Using new may result in less _____ memory than using an array
Select an option to see the answer and solution.
The most common operation used in constructors is
A. addition
B. overloading
C. assignment
D. polymorphism
Select an option to see the answer and solution.
In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false?
A. the program searches for the last else in the program
B. nothing
C. control 'falls through' to the statement following 'if
D. the body of the statement is executed
E. None of the above
Select an option to see the answer and solution.
If two types of errors may be thrown, you should write _______
A. no catch blocks
B. one catch block with two arguments
C. two catch block-one with an argument, and one without
D. two catch blocks with one argument each
Select an option to see the answer and solution.
The name of a function ends with
A. double quotes
B. single quotes
C. parenthesis
D. hash
E. None of the above
Select an option to see the answer and solution.
Which of the following is not a programming control structure?
A. repetition
B. selection
C. sequency
D. sorting
Select an option to see the answer and solution.
The bitwise OR operator is a
A. unary operator
B. binary operator
C. ternary operator
D. octal operator
E. None of the above
Select an option to see the answer and solution.
A class Stockltems has four data members and three function members. You define 50 objects as members of the class. Which is true?
A. Only one copy of each of the three functions exists
B. Only one copy of each of the four data members exists
C. Both (a) and (b) are true
D. Neither (a) nor (b) is true
Select an option to see the answer and solution.
The continue statement should be written only
A. in the body of a loop
B. in the nested loops
C. outside the body of a loop
D. any where
E. None of the above
Select an option to see the answer and solution.
A major advantage of inheritance is
A. reducing the time it takes to create new objects
B. not having to think about how objects will be used
C. reducing the amount of memory required to execute a progrma
D. enabling people who have not studied programming to create useful applications
Select an option to see the answer and solution.