Chapter 1 Questions
c. expanded
d. compact
9. What must be known about the ADT Bag in order to use it in a program?
a. how entries in the bag are represented
b. how bag operations are implemented
c. how many entries can be stored in the bag
d. the interface of the bag
10. According the CRC specifications for a Bag, which of the following behaviors would not be one of the
responsibilities of the class Bag?
a. See if the bag is empty
b. See if the bag is full
c. Look at all the objects in the bag
d. Count the number of times a certain object occurs in the bag
11. A client program depends solely on the ______ of the ADT.
a. data members
b. structure
c. implementation
d. behavior
12. What should a programmer do before implementing a recently designed class?
a. write code that uses the class
b. check comments that document specifications
c. adjust the design when problems are discovered
d. all of these
13. Object-oriented programming views a program as ______.
a. a sequence of actions
b. a collection of classes
c. a group of methods
d. an interaction among objects
14. An ADT’s operations are known as its ______.
a. axioms
b. methods
c. variables
d. interfaces
15. Encapsulation combines an ADT’s data with its operations to form a(n) ______.
a. exception
b. method
c. object
d. variable