CS150 Intro C++ Flashcards
The value in ________ local variable is retained between function calls
a. a global b. an internal c. a static d. a dynamic e. no
ch6-2
a static
When a function just needs to use a copy of an argument passed to it, the argument should normally be passed
a. by variable. b. by value. c. by reference. d. as a string
ch6-2
by value.
When used as a parameter, a ________ variable allows a function to access and modify the original argument passed to it
a. static b. value c. reference d. floating-point e. default value
ch6
c. reference
True/False:
It is possible for a function to have some parameters with default arguments and some without.
ch6
True
Two or more functions may have the same name provided that
a. they do different things. b. one has a prototype and the other doesn't. c. their parameter lists are different. d. their return types are different. e. either C or D is true.
ch6
their parameter lists are different.
When more than one function has the same name they are called ________ functions.
a. overloaded b. renamed c. parallel d. identical e. sister
ch6
overloaded
The ________ statement causes a function to end and the flow of control to move back to the point where the function call was made.
a. end b. break c. continue d. return e. exit
ch6
return
True/False:
If a function has no return statement, the flow of control moves to the next function in the file when the closing brace of the function body is reached.
ch6
False
The ________ function causes the entire program to terminate, regardless of which function or control mechanism is executing.
a. terminate() b. return() c. continue() d. exit() e. break()
ch6
a. terminate()
A ________ is a program module whose purpose is to test other modules by calling them.
a. stub b. driver c. main function d. dummy program e. pseudocode routine
ch6
driver
Once a class is declared, how many objects can be created from it?
a. 1 b. 2 c. Many d. None
ch7
Many
True/False:
Object‐oriented programming is centered around objects that include both data and the func ons that operate on them.
ch7
True
ADT stands for ________ Data Type.
a. Abstract b. Action c. Algorithmic d. Automatic e. None of the above
ch7
Abstract
In an ADT the implementation details are ________ the interface through which a program uses it.
a. a part of
b. determined by
c. kept separate from
d. used by
e. None of the above
ch7
kept separate from
Objects permit data hiding. This means they can keep function outside the class from
a. directly accessing the data.
b. changing the data.
c. knowing the names of the variables holding the data.
d. deleting the data.
e. doing all of the above
ch7
doing all of the above
True/False:
A class declaration provides a pattern for creating objects, so when a class is declared it automatically creates an object.
ch 7
False
When three different objects of a particular class are created, they are said to be separate______ of the class.
a. members
b. ADTs
c. instances
d. children
e. None of the above
ch7
instances
In OOP terminology, an object’s member variables are often called its _____, and its member functions are sometimes referred to its _____.
a. values, operators
b. data, activities
c. attributes, activities
d. attributes, methods
e. values, activities
ch7
attributes, methods
When the body of a member function is defined inside a class declaration, it is call a(n) _____ function.
a. static
b. global
c. inline
d. conditional
e. constructor
ch7
inline