A default catch block catches
A. all thrown
objects
B. no thrown
objects
C. any thrown object that has not been caught by an earlier catch block
D. all thrown
objects that have been caught by an earlier catch block
View Answer Workspace Report Discuss in Forum
3.
Adding a derived class to a base class requires fundamental
changes to the base class
A. True B. False
View Answer Workspace Report Discuss in Forum
4.
Format flags may be combined using
A. the
bitwise OR operator (|)
B. the logical
OR operator (||)
C. the bitwise
AND operator (&)
D. the logical
AND operator (&&)
View Answer Workspace Report Discuss in Forum
5.
The use of the break statement in a switch statement is
A. optional
B. compulsory
C. not allowed.
It gives an error message
D. to check an
error
E.
None of the above
6.
To expose a data member to the program, you must declare the
data member in the _____ section of the class
A. common B. exposed
C. public D. unrestricted
E. user
View Answer Workspace Report Discuss in Forum
7.
Evaluate the following expression: 3 >6&&7>4
A. True B. False
View Answer Workspace Report Discuss in Forum
8.
Which of the following are valid characters for a numeric
literal constant?
A. a comma
B. a dollar sign
($)
C. a percent
sign (%)
D. a space
E. None of the above
View Answer Workspace Report Discuss in Forum
9.
A function that changes the state of the cout object is
called a(n) _____
A. member B. adjuster
C. manipulator D. operator
View Answer Workspace Report Discuss in Forum
10.
A C++ program contains a function with the header int
function(double d, char c). Which of the following function headers could be
used within the same program?
A. char
function(double d, char c)
B. int
function(int d, char c)
C. both (a) and
(b)
D. neither (a)
nor (b)
11.
When the compiler cannot differentiate between two
overloaded constructors, they are called
A. overloaded B. destructed
C. ambiguous D. dubious
View Answer Workspace Report Discuss in Forum
12.
Some Streams work with input, and some with output
A. True B. False
View Answer Workspace Report Discuss in Forum
13.
If you design a class that needs special initialization
tasks, you will want to design a(n) _____
A. housekeeping
routine
B. initializer
C. constructor
D. compiler
View Answer Workspace Report Discuss in Forum
14.
Which type of statement does not occur in computer programs?
A. sequence B. loop
C. denial D. selection
View Answer Workspace Report Discuss in Forum
15.
The newline character is always included between
A. pair of
parentheses
B. pair of curly
braces
C. control string
D. &
E. None of the
above
16.
To be called object-oriented, a programming language must
allow
A. functions
that return only a single value
B. #include
files
C. inheritance
D. All of the
above
View Answer Workspace Report Discuss in Forum
17.
A function that returns no values to the program that calls
it is _____
A. not allowed
in C++
B. type void
C. type empty
D. type barren
View Answer Workspace Report Discuss in Forum
18.
The keyword used to define a structure is _____
A. stru B. stt
C. struct D. structure
View Answer Workspace Report Discuss in Forum
19.
If container classes are carefully constructed, then these
tools are available to work with structures that are not ______
A. valid without
container classes
B. programmer-defined
C. type-specific
D. public
View Answer Workspace Report Discuss in Forum
20.
Header files often have the file extension _____
A. .H B. .HE
C. .HEA D. .HEAD
21.
The #ifndef directive tests to see whether ________
A. a class has been defined
B. a variable
has been given a value
C. a class has
no variable definitions
D. any objects
of the class have been instantiated
View Answer Workspace Report Discuss in Forum
22.
Which of the following statements is false?
A. A function is
a block of code that performs a specific task
B. Functions
allow programmers to break large and complex problems into small and manageable
tasks
C. Functions
allow programmers to use existing code to perform common tasks
D. Functions can be called, or invoked, only once in a program
E. Programmer-defined
functions can be either value-returning or void
View Answer Workspace Report Discuss in Forum
23.
The generic type in a template function
A. must be T
B. can be T
C. cannot be T
for functions you create, but may be for C++'s built-in functions
D. cannot be T
View Answer Workspace Report Discuss in Forum
24.
When a child class function is called, the compiler looks
first for a matching function name in the _____
A. class of the object using the function name
B. immediate
ancestor class
C. base class
D. descendant
class
View Answer Workspace Report Discuss in Forum
25.
A function that is called automatically each time an object
is destroyed is a
A. constructor B. destructor
C. destroyer D. terminator
26.
If you create an instantiation of a class template with an
int, and then create a second instantiation with a double, then
A. you must precede each function call with the word int or double
B. once a
function is used as one type, it becomes unavailable for use with the other
type
C. there is no
difference in the procedure to call a member function
D. you cannot
perform this operation in C++
View Answer Workspace Report Discuss in Forum
27.
The step-by-step instructions that solve a problem are
called _____
A. an algorithm
B. a list
C. a plan
D. a sequential
structure
View Answer Workspace Report Discuss in Forum
28.
The type to be used in an instantiation of a class template
follows ________
A. the generic class name
B. the keyword
template
C. the keyword
class
D. the template
definition
View Answer Workspace Report Discuss in Forum
29.
Which of the following statements allows the user to enter
data at the keyboard?
A. cin <<
currentPay;
B. cin
>> currentPay;
C. cout <<
currentPay;
D. cout >>
currentPay;
E. None of the
above
View Answer Workspace Report Discuss in Forum
30.
When you pass a variable _____, C++ passes only the contents
of the variable to the receiving function
A. by reference
B. by value
C. globally
D. locally
31.
The best form of coupling is _____
A. complete B. tight
C. loose D. free
View Answer Workspace Report Discuss in Forum
32.
Paying attention to the important properties while ignoring
inessential details is known as________
A. selectiveness B. polymorphism
C. abstraction D. summarizing
View Answer Workspace Report Discuss in Forum
33.
What does C++ append to the end of a string literal
constant?
A. a space
B. a number sign
(#)
C. an asterisk
(*)
D. a null character
View Answer Workspace Report Discuss in Forum
34.
An array name is a _____
A. subscript
B. formal
parameter
C. memory address
D. prototype
View Answer Workspace Report Discuss in Forum
35.
To enter a comment in a program, you begin the comment with
_____
A. ** B. &&
C. \\ D. @
E. //
36.
Which of the following is(are) invalid string constant(s)?
A. '7.15 pm'
B. "i like
e"
C. "7.3el2"
D. "1234el2"
E. None of the
above
View Answer Workspace Report Discuss in Forum
37.
You define a structure type globally because _____
A. you save
many lines of code by not rewriting an identical structure definition in each
function that uses it
B. you will
never change its definition
C. it is
required in C++
D. All of the
above
View Answer Workspace Report Discuss in Forum
38.
Overloaded functions are required to
A. have the same
return type
B. have the same
number of parameters
C. perform the
same basic functions
D. None of the above
View Answer Workspace Report Discuss in Forum
39.
Redirection redirects
A. a stream from a file to the screen
B. a file from a
device to a stream
C. a device from
the screen to a file
D. the screen
from a device to a stream
View Answer Workspace Report Discuss in Forum
40.
You mark the beginning of a function's block of code with
the _____
A. /
B. *
C. {
D. }
E. either (c)
or (d) can be used
41.
Sending a copy of data to a program module is called _______
A. passing a value
B. making a
reference
C. recursion
D. setting a
condition
View Answer Workspace Report Discuss in Forum
42.
Of the three ways to pass arguments to functions, only
passing by _____ and passing by _____ allow the function to modify the argument
in the calling program
A. reference, pointer
B. array,
location
C. pointer,
reference
D. None of the
above
View Answer Workspace Report Discuss in Forum
43.
To use either an input or output file, the program must
include the _____ header file
A. filestream.h B. fstream.h
C. instream.h D. inoutstream.h
E. iostream.h
View Answer Workspace Report Discuss in Forum
44.
A widget is to the blueprint for a widget as an object is to
A. a member
function
B. a class
C. an operator
D. a data item
View Answer Workspace Report Discuss in Forum
45.
C++ allows you to define the same functions more than once
in the same program _____
A. if the
definitions are identical
B. if the
definitions are included in two separate #include files
C. if the
definitions are located in a single #include file that is included more than
once
D. C++ does
not allow you to define the same functions more than once in the same program
46.
Which of the following assigns the number 5 to the area
variable?
A. area 1 = 5
B. area = 5
C. area == 5
D. area --> 5
E. area <
> 5
View Answer Workspace Report Discuss in Forum
47.
A base class may also be called a
A. child class
B. subclass
C. derived class
D. parent class
View Answer Workspace Report Discuss in Forum
48.
The _____ mode tells C++ to open a file for input
A. add::ios B. in::file
C. ios::app D. ios::in
E. ios::out
View Answer Workspace Report Discuss in Forum
49.
Using the wardrobe structure within the ShopList structure
is an example of a good programming principle, known as _____
A. reusability B. polymorphism
C. redundancy D. recursion
1.
When you omit parameters from a function call, values can be
provided by
A. formal
parameters
B. reference
parameters
C. overloaded
parameters
D. default parameters
View Answer Workspace Report Discuss in Forum
2.
The first element in a string is
A. the name of
the string
B. the first character in the string
C. the length of
the string
D. the name of
the array holding the string
View Answer Workspace Report Discuss in Forum
3.
Variables declared outside a block are called _____
A. global B. universal
C. stellar D. external
View Answer Workspace Report Discuss in Forum
4.
The compiler converts your C++ instructions into _____
A. edited code
B. object
code
C. source code
D. translated
code
View Answer Workspace Report Discuss in Forum
5.
A fundamental type such as int or double is a _____
A. programmer-defined
type
B. complex type
C. nonscalar
type
D. scalar type
6.
The return type you code for all constructors is _____
A. void
B. the class
type
C. the same type
as the first data member defined in the class
D. no type
View Answer Workspace Report Discuss in Forum
7.
When an object-oriented program detects an error within a
function, the function _________
A. throws an exception
B. throws a fit
C. catches a
message
D. catches an
exception
View Answer Workspace Report Discuss in Forum
8.
Using a statement at the wrong time or with an inappropriate
object creates a
A. logical error
B. syntax error
C. compiler
error
D. language
error
View Answer Workspace Report Discuss in Forum
9.
When you create a derived class and instantiate an object
_____
A. the parent class object must be constructed first
B. the child
class object must be constructed first
C. the parent
class object must not be constructed
D. the child
class object must not be constructed
View Answer Workspace Report Discuss in Forum
10.
Evaluate the following expression: 4 >6 || 10 < 2 * 6
A. True B. False
11.
A constructor always has
A. communicational
cohesion
B. temporal cohesion
C. logical
cohesion
D. no cohesion
View Answer Workspace Report Discuss in Forum
12.
A normal C++ operator that acts in special ways on newly
defined data types is said to be
A. glorified B. encapsulated
C. classified D. overloaded
View Answer Workspace Report Discuss in Forum
13.
A function in a derived class that has the same name as a
function in the parent class
A. will override the base class function
B. will cause an
error message to display
C. will be
overridden by the base class function
D. will execute
immediately often the base class function executes
View Answer Workspace Report Discuss in Forum
14.
In which statements, does a 'continue' statements cause the
control to go directly to the test condition and then continue the looping
process?
A. 'for' and
'while'
B. 'while' and
'if-else'
C. 'do-while'
and 'if-else'
D. 'while' and 'do-while'
E. None of the
above
View Answer Workspace Report Discuss in Forum
15.
Which of the following statements is false?
A. You typically
use a public member function to change the value in a private data member
B. Because the
constructor function does not return a value, you place the keyword void before
the constructor's name
C. The public
member functions in a class can be accessed by any program that uses an object
created from that class
D. An instance
of a class is considered an object
16.
In a class specifier, data or functions designated private
are accessible
A. to any
function in the program
B. only if you
know the password
C. to member functions of that class
D. only to
public members of the class
View Answer Workspace Report Discuss in Forum
17.
When a function includes a throw statement for errors, the
call to the potentially offending function should be placed within a _____
block
A. throw B. try
C. catch D. scope
View Answer Workspace Report Discuss in Forum
18.
The scope resolution operator is
A. a comma
B. a semicolon
C. a colon
D. two colons
View Answer Workspace Report Discuss in Forum
19.
"C++" is a _____ constant
A. character
literal
B. named literal
C. numeric
literal
D. string literal
View Answer Workspace Report Discuss in Forum
20.
In a C++ program, which of the following can be thrown?
A. scalar
variables
B. programmer-defined objects
C. both (a) and
(b)
D. neither (a)
nor (b)
21.
The items listed in the function header are called _____
A. actual arguments
B. formal parameters
C. passed
parameters
D. sent
arguments
View Answer Workspace Report Discuss in Forum
22.
A translator that notes whether you have used a language
correctly may be called a _____
A. theasurus B. compiler
C. coder D. decoder
View Answer Workspace Report Discuss in Forum
23.
The feature in object-oriented programming that allows the
same operation to be carried out differently, depending on the object, is_____
A. inheritance B. polymorphism
C. overfunctioning D. overriding
View Answer Workspace Report Discuss in Forum
24.
When an argument is passed by reference,
A. a variable is created in the function to hold the argument's value
B. the function
cannot access the argument's value
C. a temporary
variable is created in the calling program to hold the argument's value
D. the function
accesses the argument's original value in the calling program
E. None of the
above
View Answer Workspace Report Discuss in Forum
25.
The process of extracting the relevant attributes of an object
is known as
A. polymorphism
B. inheritance
C. abstraction
D. data hiding
26.
Which of the following statements uses the computer's clock
to initialize the random number generator?
A. srand(time); B. srand(time(NULL));
C. time(srand); D. time(srand(NULL));
View Answer Workspace Report Discuss in Forum
27.
A static data member is given a value
A. within the
class definition
B. outside the class definition
C. when the
program is executed
D. never
View Answer Workspace Report Discuss in Forum
28.
You must provide a constructor for a derived class
A. always
B. if the base class constructor required arguments
C. if the base
class constructor does not required arguments
D. never
View Answer Workspace Report Discuss in Forum
29.
If you want to override constructor default values for an
object you are instantiating, you must also override
A. all other
parameters to that constructor
B. all parameters to the left of that value
C. all
parameters to the right of that value
D. no other
parameters to that constructor
View Answer Workspace Report Discuss in Forum
30.
To use one of the C++ built-in mathematical functions, you
must include the _____ header file in your program
A. calculation.h B. compute.h
C. expression.h D. math.h
E. mathematical.h
31.
Errors in a program are called
A. accidents
B. annoyances
C. bugs
D. mistakes
E. typing
errors
View Answer Workspace Report Discuss in Forum
32.
If you declare two objects as Customer firstCust,
secondCust; which of the following must be true?
A. Each object's
nonstatic data members will be stored in the same memory location
B. Each object
will be stored in the same memory location
C. Each object will have a unique memory address
D. You cannot
declare two objects of the same class
View Answer Workspace Report Discuss in Forum
33.
Which of the following is the inequality operator?
A. != B. =
C. == D. -->
E. <>
View Answer Workspace Report Discuss in Forum
34.
If a derived class uses the public access specifier, then
_____
A. public base class members remain public in the derived class
B. protected
base class members become public in the derived class
C. both (a) and
(b)
D. neither (a)
nor (b)
View Answer Workspace Report Discuss in Forum
35.
The operator that releases previously allocated memory is
_____
A. release B. return
C. delete D. destroy
36.
When a language has the capability to produce new data
types, it is said to be
A. reprehensible B. encapsulated
C. overloaded D. extensible
View Answer Workspace Report Discuss in Forum
37.
A compound statement does not consist of
A. a single statement
B. other
compound statements
C. expression
statements
D. control
statements
E. None of the
above
View Answer Workspace Report Discuss in Forum
38.
Which of the following statements will display the word
"Hello" on the computer screen?
A. cin <<
"Hello";
B. cin >>
"Hello";
C. cout
<< "Hello";
D. cout >>
"Hello";
E. None of the
above
View Answer Workspace Report Discuss in Forum
39.
The preprocessor directive always starts with the symbol
A. %
B. &
C. #
D. ""
E. None of the
above
View Answer Workspace Report Discuss in Forum
40.
Which of the following statements is true?
A. Data coupling
is tighter than pathological coupling
B. Common
coupling is looser than data coupling
C. Data-structured coupling is looser than control coupling
D.
Control coupling is looser than data coupling
41.
Evaluate the following expression: 7 >=3 + 4 || 6<4
&& 2<5
A. True B. False
View Answer Workspace Report Discuss in Forum
42.
The base class for most stream classes is the _____ class
A. ios B. out
C. in D. app
View Answer Workspace Report Discuss in Forum
43.
Which of the following while clause will stop the loop when
the value in the age variable is less than the number 0?
A. while age
< 0
B. while (age
< 0)
C. while age
>= 0;
D. while (age
>= 0);
E. while
(age >= 0)
View Answer Workspace Report Discuss in Forum
44.
The most efficient data type for a variable that stores the
number 4.6e20 is the _____ data type
A. Character
B. Double
C. Float
D. Long Integer
E. Short
Integer
View Answer Workspace Report Discuss in Forum
45.
Which of the following is a C++ object?
A. cin B. >>
C. iostream D. read()
46.
Which of the following can be used to declare the main
function?
A. void main
B. void Main()
C. void main()
D. main
E. either (b)
or (c) can be used
View Answer Workspace Report Discuss in Forum
47.
You _____ write your own container classes
A. must
B. may
C. should not
D. must not
View Answer Workspace Report Discuss in Forum
48.
If an integer object is thrown with a throw statement, then
a subsequent catch block has a usable match if the type of the catch argument
is
A. int
B. double
C. either (a) or
(b)
D. neither (a)
nor (b)
View Answer Workspace Report Discuss in Forum
49.
The highest level of cohesion is
A. functional cohesion
B. temporal
cohesion
C. logical
cohesion
D. sequential
cohesion
View Answer Workspace Report Discuss in Forum
50.
You separate a derived class name from its access specifier
with
A. a colon
B. two colons
C. at least one space
D. a semicolon
1.
The last statement in a function is often a(n) _____
A. return B. goodbye
C. finish D. endfunction
View Answer Workspace Report Discuss in Forum
2.
When the function int someFunction(char c) throw( ) is
executed, _____
A. it can throw
anything
B. it may throw
an integer
C. it may throw
a character
D. it may not throw anything
View Answer Workspace Report Discuss in Forum
3.
The two statements that can be used to change the flow of
control are
A. if and switch
B. if and while
C. switch and
do-while
D. break and
continue
E. None of the
above
View Answer Workspace Report Discuss in Forum
4.
If p and q are assigned the values 2 and 3 respectively then
the statement P = q++
A. gives an
error message
B. assigns a value
4 to p
C. assigns a value 3 to p
D. assigns a
value 5 to p
E. None of the
above
View Answer Workspace Report Discuss in Forum
5.
Which of the following is the insertion operator?
A. >>
B. <<
C. //
D. /*
E. both (a) and
(b)
6.
If you want only one memory location to be reserved for a
class variable, no matter how many objects are instantiated, you should declare
the variable as
A. static B. unary
C. dynamic D. volatile
View Answer Workspace Report Discuss in Forum
7.
To use a template class member function, use the ________
with the instantiation
A. scope
resolution operator
B. dot operator
C. class
definition
D. keword
template
View Answer Workspace Report Discuss in Forum
8.
When a class is derived from another derived class, the
newly derived class
A. may have more
liberal access to a base class member than its immediate predecessor
B. may have the
same type of access to a base class member as its immediate predecessor
C. may have
more limited access to a base class member than its immediate predecessor
D. both (b) and
(c)
View Answer Workspace Report Discuss in Forum
9.
If you assign a default value to any variable in a function
prototype's parameter list, then _____
A. all other
parameters in the function prototype must have default values
B. all parameters to the right of that variable must have default values
C. all
parameters to the left of that variable must have default values
D. no other
parameters in that prototype can have default values
View Answer Workspace Report Discuss in Forum
10.
The dot operator (or class member access operator) connects
the following two entities (reading from left to right):
A. a class
member and a class object
B. a class
object and a class
C. a class and a
member of that class
D. a class object and a member of that class
11.
Which of the following calls a function named displayName,
passing it no actual arguments?
A. call
displayName;
B. call
displayName ();
C. displayName;
D. displayName();
View Answer Workspace Report Discuss in Forum
12.
The feature that allows you to use the same function name
for separate functions that have different argument lists is called _____
A. overriding B. overloading
C. constructing D. destructing
View Answer Workspace Report Discuss in Forum
13.
Which of the following are valid characters constants?
A. '\n'
B. '\\'
C. '\0'
D. All of the above
E. None of the
above
View Answer Workspace Report Discuss in Forum
14.
With a template class, _____ type is generic
A. no
B. exactly one
C. at least one
D. at most one
View Answer Workspace Report Discuss in Forum
15.
If you want to use a class to define objects in many
different programs, you should define the class in a C++ _____ file
A. header B. program
C. source D. text
16.
Functions that returns information about an object's state
can be classified as ________
A. inspector
functions
B. mutator
functions
C. auxiliary
functions
D. manager
functions
View Answer Workspace Report Discuss in Forum
17.
An auxiliary function _____
A. return
information about data members
B. changes the
state of data members
C. performs an action or service
D. creates and
destroys objects
View Answer Workspace Report Discuss in Forum
18.
To create and execute a C++ program, you need to have access
to
A. a C++
compiler
B. a C++
translator
C. an object code editor
D. a text editor
E. both (a) and
(d)
View Answer Workspace Report Discuss in Forum
19.
If you omit any constructor argument when you instantiate an
object, you must use default values______
A. for all
parameters to the constructor
B. for all parameters to the right of the argument
C. for all
parameters to the left of the argument
D. for no other
parameters
View Answer Workspace Report Discuss in Forum
20.
Many programmers separate a class into two files: _____
A. one for the declarations and one for the implementations
B. one for the
void functions and one for the other functions
C. one for the
public data and one for the private data
D. one for the
primary functions and one for the auxiliary functions
21.
Files whose names end in .h are called _____ files
A. handy B. header
C. helper D. helping
View Answer Workspace Report Discuss in Forum
22.
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
View Answer Workspace Report Discuss in Forum
23.
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
View Answer Workspace Report Discuss in Forum
24.
Inheritance occurs when a class adopts all the traits of
_________
A. an object
B. a parent class
C. a variable
D. a function
View Answer Workspace Report Discuss in Forum
25.
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
26.
A _____ is a single item of information about a person,
place, or thing
A. data file
B. field
C. program file
D. record
View Answer Workspace Report Discuss in Forum
27.
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
View Answer Workspace Report Discuss in Forum
28.
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);
View Answer Workspace Report Discuss in Forum
29.
A file pointer always contains the address of the file
A. True B. False
View Answer Workspace Report Discuss in Forum
30.
You declare a function with a function _____, which is
typically entered at the beginning of the program, below the #include
directives
A. call B. declaration
C. definition D. prototype
31.
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
View Answer Workspace Report Discuss in Forum
32.
Using new may result in less _____ memory than using an
array
A. wasted B. used
C. RAM D. ROM
View Answer Workspace Report Discuss in Forum
33.
The most common operation used in constructors is
A. addition B. overloading
C. assignment D. polymorphism
View Answer Workspace Report Discuss in Forum
34.
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
View Answer Workspace Report Discuss in Forum
35.
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
36.
The name of a function ends with
A. double quotes
B. single quotes
C. parenthesis
D. #
E. None of the
above
View Answer Workspace Report Discuss in Forum
37.
Which of the following is not a programming control
structure?
A. repetition B. selection
C. sequency D. sorting
View Answer Workspace Report Discuss in Forum
38.
The bitwise OR operator is a
A. unary
operator
B. binary operator
C. ternary
operator
D. octal
operator
E. None of the
above
View Answer Workspace Report Discuss in Forum
39.
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 tnree 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
View Answer Workspace Report Discuss in Forum
40.
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
41.
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
View Answer Workspace Report Discuss in Forum
42.
When a variable exists or is accessible, it is said to be
_____
A. immediate
B. in the path
C. available
D. in scope
View Answer Workspace Report Discuss in Forum
43.
The feature that allows the same operations to be carried
out differently depending on the object is _____
A. polymorphism B. polygamy
C. inheritane D. multitasking
View Answer Workspace Report Discuss in Forum
44.
Which of the following is a C++ class?
A. >> B. read()
C. cin D. iostream
View Answer Workspace Report Discuss in Forum
45.
Precedence determines which operator
A. is evaluated first
B. is most
important
C. is fastest
D. operates on
the largest number
E. None of the
above
46.
When using the standard files that come with the C++
compiler, you should surround the header file name with _____
A. square
brackets
B. angle
brackets
C. parentheses
D. quotes
View Answer Workspace Report Discuss in Forum
47.
The loop condition in a flowchart is represented by a(n)
_____
A. diamond B. oval
C. parallelogram D. rectangle
View Answer Workspace Report Discuss in Forum
48.
Which of the following, if any, are invalid names for a
variable?
A. bankAccountNumber
B. first_Name
C. doubleNumber
D. operator
E. All of the
above are valid names for variables
49.
Inheritance is the principle that
A. classes with
the same name must be derived from one another
B. knowledge of a general category can be applied to more specific objects
C. C++ functions
may be used only if they have logical predecessors
D. one function
name may invoke different methods
1.
You typically initialize a String variable to _____
A. an asterisk
B. a space
enclosed in single quotes
C. the number 0
D. a zero-length string
View Answer Workspace Report Discuss in Forum
2.
The set of instructions for how to tie a bow is an example
of the _____ structure
A. control B. repetition
C. selection D. sequence
E. switching
View Answer Workspace Report Discuss in Forum
3.
If no exception is thrown ________
A. a catch block
will cause an error
B. the first
catch block coded will execute
C. the last
catch block coded with execute
D. any catch blocks coded with be bypassed
View Answer Workspace Report Discuss in Forum
4.
A program that predicts the exact sequence in which events
will take place is said to be ________
A. compiled B. interpreted
C. procedural D. object-oriented
View Answer Workspace Report Discuss in Forum
5.
A blueprint for creating an object in C++ is called _____
A. a class
B. an instance
C. a map
D. a pattern
E.
a sketch
6.
The prototype for a derived class constructor may include
arguments for
A. data members
of the derived class
B. data members
of the base class
C. both (a)
and (b)
D. neither (a)
nor (b)
View Answer Workspace Report Discuss in Forum
7.
Overloading involves writing two or more functions with
________
A. different
names and different argument lists
B. different
names and the same argument list
C. the same name and different argument lists
D. the same name
and the same argument list
View Answer Workspace Report Discuss in Forum
8.
You___________overload function templates
A. may, as long
as each version has the same arguments
B. may, as long as each version has different arguments
C. must
D. must not
View Answer Workspace Report Discuss in Forum
9.
You typically initialize Character variables to _____
A. a space
enclosed in double quotes
B. a space enclosed in single quotes
C. the letter O
D. the number 0
E. the value
false
View Answer Workspace Report Discuss in Forum
10.
One way pointers are useful is to refer to a memory address
that has no _____
A. name B. constant
C. location D. field
11.
A member function uses the correct object when you call it
because
A. a copy of the
object is passed to the function
B. the address of the object is passed to the function
C. the address of
the function is passed to another function
D. the address
of the object is returned from the function
View Answer Workspace Report Discuss in Forum
12.
Two access specifiers in C++ are
A. public and private
B. int and
double
C. formal and
informal
D. void and free
View Answer Workspace Report Discuss in Forum
13.
Which of the following is the fourth problem-solving step?
A. analyze the
problem
B. evaluate and
modify (if necessary) the program
C. code the algorithm
D. plan the
algorithm
E. desk-check
the program
View Answer Workspace Report Discuss in Forum
14.
Within parentheses, catch blocks can have _____
A. no arguments
B. one argument
C. two arguments
D. as many
arguments as necessary
View Answer Workspace Report Discuss in Forum
15.
The while loop is referred to as a(n) _____ loop because the
loop condition is tested at the beginning of the loop
A. beginning B. initial
C. pretest D. priming
16.
The word case used in the switch statement represents a
A. function in
the C++ language
B. data type in
the C++ language
C. keyword in the C++ language
D. global
variable in the C++ language
E. None of the
above
View Answer Workspace Report Discuss in Forum
17.
Function templates _____________
A. must have
exactly one parameter
B. may have more
than one parameter as long as they are of the same type
C. may have more than one parameter of any type
D. may not have
parameters

0 Comments