17.
Assuming the following three operators appear in an
expression (without parentheses), which of the operators will be performed
first?
A. && B. !
C. || D. [NIL]
18.
The code that you enter into a C++ program is called _____
A. console code
B. object code
C. project code
D. source code
19.
If a base class member is private, then
A. if a derived
class uses the public access specifier, the data member becomes public
B. if a derived
class uses the protected access specifier, the data member becomes protected
C. both (a) and
(b)
D. neither (a)
nor (b)
20.
Which of the following instructions tells C++ to merge the
source code from the iostream.h file into the current file?
A. #include
<iostream.h>
B. #include
iostream.h
C. #include
<iostream.h>
D. #merge
iostream.h
E. None of the above
21.
The statement double total = 0.0; performs _____
A. assignment B. initialization
C. rationalization D. polymorphism
22.
The two parts of a function are the
A. header and
footer
B. declarations
and statements
C. legs and feet
D. header and body
23.
The general principle underlying object-oriented error
handling is that a called function should __________
A. neither check
for, nor handle errors
B. check for
errors but not be required to handle any detected
C. handle errors, but not check for them
D. both
check for and handle errors
24.
Which of the following is false?
A. A void
function's header begins with the keyword void
B. A value-returning function's header begins with a data type,
which represents the type of data the function will return
C. Assuming
displayAge is the name of a void function, displayAge(); is a both logically
and syntactically valid C++ statement
D. Assuming
calcNewPrice is the name of a value-returning function, calcNewPriceO; is a
both logically and syntactically valid C++ statement
E. Both void
and value-returning functions can receive arguments.
25.
Reference variables and const class member
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 exit
if a class is to be a base class
26.
The actual arguments cannot he
A. a constant or
a variable
B. of a different type from the corresponding formal arguments
C. other
functions
D. expressions
E. None of the
above
27.
The function stricmp("Jose", "JOSE")
will return _____
A. - 1
B. 0
C. 1
28.
Which is true?
A. Coincidental
cohesion is stronger than procedural cohesion
B. Logical cohesion is stronger than coincidental cohesion
C. Sequential
cohesion is weaker than temporal cohesion
D. The weakest
cohesion is functional
29.
A predefined function that may be used to handle memory
allocation errors is
A. handle_error B. set_new_handler
C. new_fix D. memory_error
30.
A function in a derived class that has the same name as a
function in the parent class _____
A. will cause an
error message to display
B. will override the base class function
C. will be
overridden by the base class function
D. will execute
immediately after the base class function executes
31.
The _____ function returns the uppercase equivalent of a
character
A. caseupper B. charupper
C. toupper D. uCase
E. upper
32.
When you instantiate a derived class object, a constructor
for the derived class _____
A. is not called
B. is called
prior to the base class constructor
C. is called
simultaneously with the base class constructor
D. None of the above
33.
A constructor may be _____
A. provided
automatically by C++
B. written by
you
C. either (a)
or (b).
D. neither (a)
nor (b).
34.
Software that can be used in applications other than the one
for which it was originally written is called
A. recyclable B. inherited
C. reusable D. cheating
35.
Which of the following statements is false?
A. A class
encapsulates all of an object's attributes and behaviors
B. An example of
an attribute is the minutes variable in a time class
C. An example of
a behavior is the setTime function in a time class
D. A class is considered an object
E. An object
created from a class is referred to as an instance of the class
36.
Typing the function's name as Main, rather than main, is an
example of
A. an entry
error
B. a function
error
C. a logic error
D. a syntax error
37.
When the compiler cannot differentiate between two
overloaded constructors, they are called______
A. overloaded B. destructed
C. ambiguous D. dubious
38.
A function argument is
A. a variable in
the function that receives a value from the calling program
B. a way that
functions resist accepting the calling program's values
C. a value sent to the function by the calling program
D. a value
returned by the function to the calling program
E. None of the
above
39.
A function that is prototyped as double calculate(int num);
may______
A. receive an
integer constant such as 5
B. receive an
integer variable
C. either (a)
or (b)
D. neither (a)
nor (b)
40.
Passing a variable pointer as a constant _____
A. protects the contents pointed to by the pointer from change
B. eliminates
the need to name the pointer in the function
C. eliminates
the need to give the pointer a type in the function
D. causes a copy
of the pointer to be produced in the function
41.
Recursive Functions
A. easier to
code
B. executable
faster than iterative ones
C. takes less
main storage space
D. necessary to solve a certain class of problems
E. None of the
above
42.
The purpose of a conditional operator is to
A. select one of
the two values
B. select the
highest of the two values
C. select one of the two values depending on a condition
D. select the
more equal of the two values
E. None of the
above
43.
Which of the following, if any, are valid names for
variables?
A. amt.Sold
B. amt-Sold
C. amt_Sold
D. 98Sold
E. None of the
above are valid names for variables
44.
Assume you want to compare the character stored in the
initial variable to the letter a. Which of the following conditions should you
use in the if statement? (Be sure the condition will handle a or A.)
A. (initial =
'a' or 'A')
B. (initial ==
'a' or 'A')
C. (toupper(initial)
= 'A')
D. (toupper(initial)
== 'A')
45.
You can override a class's inherited access to make an
individual member's access more ______
A. liberal
B. conservative
C. either (a) or
(b)
D. neither (a)
nor (b)
46.
A class hierarchy
A. describes "is a kind of" relationships
B. describes
"has a" relationships
C. shows the
same relationships as an organization chart
D. shows the
same relationships as a family tree
47.
Which of the following C++ expressions is equivalent to the
mathematical expression 53 ?
A. 5 ^ 3
B. cube(5)
C. pow (3, 5)
D. pow(5, 3)
E. sqrt (5, 3)
48.
The right shift operator is represented by the symbol
A. >
B. >>
C. ->
D. <
E. None of the
above
49.
In C++, class definitions are most often
A. stored
with each program that uses them
B. stored in a
header file that is included in the programs that use them
C. stored in a
folder that you paste into every new project
D. retyped for
every new project
1.
The comma operator (,) is primarily used in conjunction with
A. 'for' statement
B. 'if-else'
statement
C. 'do-while'
statement
D. All of the
above
E. None of the
above
2.
To execute a C++ program, you first need to translate the
source code into object code. This process is called
A. coding B. compiling
C. sourcing D. translating
3.
The rules of a programming language are called its _____
A. code B. guidelines
C. procedures D. regulations
E. syntax
4.
An array element is accessed using
A. a
first-in-first-out approach
B. the dot
operator
C. a member name
D. an index number
5.
The program can access the private members of a class
A. directly
B. only through
other private members of the class
C. only through other public members of the class
D. None of the
above - the program cannot access the private members of a class in any way
6.
To hide a data member from the program, you must declare the
data member in the _____ section of the class
A. concealed B. confidential
C. hidden D. private
E. restricted
7.
External documentation includes
A. a printout of the program's code
B. flowcharts
C. IPO charts
D. pseudocode
E. All of the
above
8.
A function that is called automatically each time an object
is created is a(n)
A. constructor B. contractor
C. builder D. architect
9.
A variable's _____ indicates how long the variable remains
in the computer's memory
A. area B. extent
C. lifetime D. reach
E. scope
10.
The function whose prototype is void getData(Item *thing);
receives
A. a pointer to a structure
B. a reference
to a structure
C. a copy of a
structure
D. nothing
11.
You may override the class access specifier for_____
A. public
members
B. public and
protected members
C. any specific class members you choose
D. no clas
smembers
12.
The null character needs a space of
A. zero bytes
B. one byte
C. three bytes
D. four bytes
E. None of the
above
13.
The number of structures than can be declared in a single
statement is
A. one B. two
C. three D. unlimited
14.
The cout << sales[0] + sales[1]; statement will______
A. display 22000
B. display 10000
+ 12000
C. display
sales[0] + sales[l]
D. result in an
error
15.
The most efficient data type for a variable that stores the
letter C is the _____ data type
A. Character
B. Double
C. Float
D. Long Integer
E. Short
Integer
16.
The C++ operator used to allocate memory is _________
A. mem B. allocate
C. new D. create
17.
Assume that your version of C++ can recognize only the first
8 characters of an identifier name, through identifier names may be arbitrarily
long. Which of the following identifier names is not distinct:
A. list, list2
B. address,
Address
C. identifier_l, identifier_2
D. answer,
ANSWER
E. None of the
above
18.
Object is to class as _____
A. library is to
book
B. mother is to
daughter
C. Plato is to philosopher
D. president is
to Lincoln
19.
A derived class may also be called a
A. subclass
B. super class
C. parent class
D. base class
20.
The C++ keyword for declaring a variable that contains a
decimal point is _____
A. dec
B. decimal
C. float
D. floater
E. None of the
above

0 Comments