41
An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be
A)
assignment, relational, arithmetic
B)
arithmetic, relational, assignment
C)
relational, arithmetic, assignment
D)
assignment, arithmetic, relational
E)
None of the above
Answer & Solution
Answer: Option
B
42
The keyword virtual indicates that
A)
a derived class has public access to a base class
B)
more than one base class exists
C)
a base class should be used only once in inheritance
D)
a derived class should have more than one base class constructed
Answer & Solution
Answer: Option
C
43
If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
A)
Each object will store a separate copy of any static member data
B)
Each object will store a separate copy of any member functions
C)
Each object will store a separate copy of any nonstatic data members
D)
You cannot declare two objects of the same class
Answer & Solution
Answer: Option
C
44
Variables that are declared in a block are known as _____ variables to that block
A)
confined
B)
local
C)
global
D)
immediate
Answer & Solution
Answer: Option
B
45
The pow and sqrt functions return a(n) _____ type number
A)
double
B)
float
C)
integer
D)
long
E)
short
Answer & Solution
Answer: Option
A
46
Declaring variables is advantageous because it
A)
avoids errors from misspelled variable names
B)
helps the linker work efficiently
C)
simplifies the writing of very short programs
D)
All of the above
E)
None of the above
Answer & Solution
Answer: Option
C
47
The generic name used for unexpected errors that occur during the execution of a program is
A)
infractions
B)
exceptions
C)
deviations
D)
anomalies
Answer & Solution
Answer: Option
B
48
You add the desired type to a specific template class instantiation by placing the type's name ______
A)
between angle brackets
B)
in parentheses
C)
on a line by itself
D)
immediately prior to the class name
Answer & Solution
Answer: Option
A
49
The switch variable can be of
A)
int type only
B)
char type only
C)
both int as well as char type
D)
float type only
E)
None of the above
Answer & Solution
Answer: Option
C
50
Reference variables and const class members _____
A)
must be assigned values in any derived class
B)
must never be initialized in a base class
C)
must be initialized, rather than assigned values
D)
must not exist if a class is to be a base class
Answer & Solution
Answer: Option
C