42.
The end of string is recognized by
A. the null
character
B. the newline
character
C. the $ sign
D. the / sign
E. None of the
above
43.
Variable names known only to the procedure in which they are
declared are ________
A. local B. global
C. recent D. internal
44.
The strcpy(empName[0], empName[2]); statement will
A. replace the
letter M with the letter r
B. replace the
letter M with the letter J
C. replace the
letter M witht he letters S
D. replace
the name Mary with the name Sue
E. replace the
name Sue with the name Mary
45.
Whis is true?
A. A derived
class may have more than one base class
B. A base class
may have more than one derived class
C. both (a)
and (b)
D. neither (a)
nor (b)
46.
The keyword used to define a structure is
A. stru B. stt
C. struct D. unlimited
47.
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
48.
The C++ expression p --> val means the same thing as
A. *p.val B. *(p.val)
C. (*p).vai D. p.val
49.
Which of the following tells C++ to display numbers with
zero decimal places?
A. setiosflags(0) B. setiosflags(zero)
C. setprecision(0) D. setprecision(zero)
50.
Code that has already been tested is said to be _____
A. inherited B. reusable
C. reliable D. polymorphic
1.
If no constructors can specified for a derived class,
objects of the derived class will use the constructors in the base class
A. True B. False
2.
The get() function returns _____
A. a character
B. void
C. a
reference to the object that invoked it
D. a copy of the
object that invoked it
3.
The most efficient data type for a variable that the number
20000 is the _____ data type
A. Character
B. Double
C. Float
D. Long Integer
E. Short
Integer
4.
The number 5.5e3 is a _____ constant
A. character
literal
B. named literal
C. numeric literal
D. string
literal
5.
The compiler determines the type used in a template function
via ___________
A. the name of
the function
B. the first
variable declared within the function
C. the type of the argument passed to the function
D. the type of
the value returned from the function
6.
Simple routines that programmers use as place holders while
a system is being tested are called _____
A. stubs B. stumps
C. holders D. templates
7.
You can place function templates
A. at the end of
main()
B. at the
start of a program above main()
C. in two
files-one for the definition and one for the function
D. any of the
above
8.
The two operators && an || are
A. arithmetic
operators
B. equality
operators
C. logical operators
D. relational
operators
E. None of the
above
9.
The arguments that determine the state of the cout object
are called _____
A. classes
B. manipulators
C. format
flags
D. state
controllers
10.
Static variables are sometimes called
A. class variables
B. functional
variables
C. dynamic
variables
D. auto
variables
11.
The variables declared in a statement block or listed in a
function header's parameterlist are considered _____ variables
A. area B. global
C. local D. reference
E. value
12.
An expression
A. is a
collection of data objects and operators that can be evaluated to a single
value
B. is a name
that substitutes for a sequence of characters
C. causes the
computer to carry out some action
D. All of the
above
E. None of the
above
13.
In the C language, the character type of constant is
delimited by using
A. single quotes
B. double quotes
C. parenthesis
D. #
E. None of the
above
14.
One way in which a structure differs from an array is that
_____
A. a structure may have members of more than one type
B. a structure
must have members that; are all the same type
C. art array may
have members of more than one type
D. there is no
difference between a structure and an array
15.
A default constructor _____
A. takes no
arguments
B. has default
values for all its arguments
C. either (a)
or (b)
D. neither (a)
nor (b).
16.
The number 125.35 is a _____
A. character
literal constant
B. numeric literal constant
C. string
literal constant
D. variable
17.
When a class serves as a base class to others, _____
A. all of its members
are inherited
B. all of its members are inherited, except for any private members
C. all of its
members are inherited, except for any protected members
D. None of its
members is inherited unless specifically "listed
18.
Storing a class definition in a separate file is an example
of
A. polymorphism
B. name mangling
C. implementation hiding
D. inheritance
19.
Which is true?
A. Sequential cohesion is slightly weaker than functional cohesion
B. Sequential
cohesion is slightly stronger than functional cohesion
C. Sequential
cohesion is much stronger than functional cohesion
D. Neither
sequential cohesion nor functional cohesion is stronger than the other
20.
A class named student must have a constructor whose name is
A. student
B. ~student
C. constructor
D. any legal C++
name.
21.
The statement double val[15]={44.123456};
A. assigns the
value 44.123456 to all members of the array val
B. assigns the value 44.123456 to val[0] and 0 to the rest of the members
C. gives an
error message
D. assigns the
value 44.12345 to val[1] and val[5]
22.
Which of the following C++ expressions will find the square
root of the number 16?
A. pow (16, 2)
(b) root (16, 2)
B. sqroot (16)
C. sqrt (16, 2)
D. sqrt (16)
23.
Which of the following does not have an unary operator ?
A. 7
B. ++i
C. j
D. All of the above
E. None of the
above
24.
It is illegal to make objects of one class members of
another class
A. True
B. False
C. depends upon
the kind of object
25.
Catch blocks must _____
A. appear in
every object-oriented program
B. appear within
try blocks
C. appear
immediately after throw statements
D. appear immediately after try blocks
26.
An exception specification begins with the keyword _____
A. exception B. try
C. throw D. catch
27.
You construct a class in two sections, known as the _____
A. header and
body
B. type and
parameters
C. declaration
and implementation
D. pointer and
variable
28.
It is sometimes useful to specify a class from which no
objects will ever be created
A. True B. False
29.
The statement i*=3 is equivalent to
A. i = 3*
B. i = 3
C. i* = 3
D. i = i * 3
E. None of the
above
30.
The complement operator is represented by the symbol
A. ~
B. ^
C. i
D. <
E. None of the
above
31.
One of the relational operators in the C language is
A. !=
B. &&
C. !
D. #
E. None of the
above
32.
Within a program, you can instantiate ________that have a
class template type
A. classes B. functions
C. parameters D. objects
33.
The rules to any programming language are its _______
A. syntax B. interpretation
C. logic D. customs
34.
Which of the following backslash codes used for bell?
A. \b
B. a
C. \r
D. \s
E. None of the
above
35.
The last statement in a value-returning function is always
_____
A. };
B. result
expression;
C. return;
D.
return expression;
36.
One of the logical operators in the C language is represented
by the symbol
A. AND
B. &&
C. >=
D. <=
E. None of the
above
37.
Which of the following declares and initializes an Integer
variable named numltems?
A. int
numltems = 0;
B. int numltems
= '0';
C. integer
numltems = 0;
D. numltems int
= 0;
E. numltems
integer = 0;
38.
Which of the following tells C++ to display numbers in fixed
notation?
A. setiosflags(fixed)
B. setiosflags(fixed:
:is)
C. setiosflags(ios,
fixed)
D. setiosflags(ios::fixed)
39.
The #include instruction is called a
A. direction
B. directive
C. merge
instruction
D. statement.
40.
Another drawback to returning an error code from a function
is that any error code returned by the function
A. must be of the same type as return type of the function
B. must not be a
character
C. cannot be
checked in a main() program
D. can have
multiple meanings
41.
Classes hold _____
A. data
B. methods
C. both data and methods
D. neither data
nor methods
42.
In C++, the address operator is the following symbol _____
A. >> B. &
C. * D. !
43.
Which of the following is false?
A. A pointer
variable contains the address of a variable in memory
B. You should
both declare and initialize a pointer before you use it
C. Pointers
are typically initialized to the empty string ("")
D. A pointer's
datatype must match the datatype of the variable to which it points
E. A pointer
variable is typically referred to simply as a pointer
44.
The function that takes arguments to set the bits of cout is
_____
A. setf() B. bitset()
C. ios() D. flat()
45.
When you declare a pointer, you must give it a _____
A. type
B. type and anme
C. type, name,
and value
D. name and
value
46.
You typically initialize Short Integer, Integer, and Long
Integer 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
47.
Assume that a variable will need to store only integers in
the range of 1 through 20000. The most efficient data type for the variable is
_____
A. character
B. float
C. integer
D. long integer
E. short integer
48.
Which of the following is true?
A. iostream is
derived from istream
B. iostream is
derived from ostream
C. ostream is derived from iostream
D. ostream is
derived from istream
1.
Which of the following are valid characters for a numeric
literal constant?
A. a decimal
point
B. the letter e
C. a minus sign
D. a plus sign
E. All of the above
2.
Any #include files may contain
A. constants
B. variables
C. functions
D. All of the above
3.
When a break statement is used in a loop, the control skips
the rest of the statements in the loop after it and jumps
A. to the last
lines in the program
B. to the next statement written after the body of the loop
C. to the first
statement in the body of the loop
D. All. of the
above
E. None of the
above
4.
The function that takes arguments to set the bits of count
is _____
A. setf() B. bitsef()
C. ios() D. flag()
5.
When two types are used in a function template and one is
labeled T, the other
A. must also be named T
B. must be named
U
C. can be any
legal C++ identfier
D. it is illegal
to have two types
6.
The best-written classes have
A. all functions
private
B. all data
public
C. no functions
D. None of the above
7.
Making class members inaccessible to nonmember functions is
an example of
A. polymorphism
B. data hiding
C. redundancy
D. recursion
8.
Providing two or more constructors for the same class _____
A. requires different argument lists
B. requires
different constructor names
C. requires
different constructor types
D. is illegal
9.
'3' is a _____ constant
A. character
literal
B. named literal
C. numeric
literal
D. string
literal
10.
_____ variables remain in memory until the statement block
ends
A. Area B. Global
C. Local D. Reference
E. Value
11.
An address is a _____ , while a pointer is a _____
A. array,
variable
B. constant,
variable
C. variable,
position
D. variable, location
12.
Procedural cohesion is similar to sequential cohesion,
except that with procedural cohesion _____
A. the tasks are
not done in order
B. the tasks are
simpler
C. the tasks
share data
D. the tasks do not share data
13.
Which of the following creates an animal object named dog?
A. animal
"dog";
B. animal
dog;
C. dog
"animal";
D. dog animal;
14.
The getline() function reads a line of text until _____
A. the length
used as the second argument is reached
B. the character
used as the third argument is reached
C. either (a)
or (b)
D. neither (a)
nor (b)
15.
The extraction operator >> is a(n)
A. overloaded function
B. C++ class
C. C++ object
D. static
reference variable
16.
One drawback to returning an error code from a function is
_____
A. functions
cannot return error codes
B. error codes
must be integers, and some functions can't return an integer

0 Comments