Exam 1 all multiple choice UPDATED ACTUAL
QUESTIONS WITH CORRECT ANSWERS
Question 1.
1. The specifications of an ADT's operations indicate ______.
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
ANSWER
a.
Question 2.
2. Data structures are part of an ADT's ______.
a. definition
b. implementation
c. specifications
d. usage
ANSWER
b.
Question 3.
3. A(n) ______ allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
ANSWER
c.
,Question 4.
4. An ADT's ______ govern(s) what its operations are and what they do.
a. specifications
b. implementation
c. documentation
d. data structure
ANSWER
a.
Question 5.
5. When each module performs one well-defined task, we say that it is ___.
a. loosely coupled
b. highly coupled
c. cohesive
d. not easily reused
ANSWER
c.
Question 6.
6. When should an operation contract be written?
a. during analysis
b. after coding
c. at the same time as user documentation
d. when taking initial notes from client
ANSWER
a.
Question 7.
7. What information is included in the operation contract?
a. the method's interface
b. data flow among the modules
c. assumptions about input
d. all of these
ANSWER
d.
,Question 8.
8. What kind of interface contains a method if and only that method is essential to that class's
responsibilities?
a. complete
b. minimal
c. expanded
d. compact
ANSWER
b.
Question 9.
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
ANSWER
d.
Question 10.
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
ANSWER
b.
Question 11.
11. A client program depends solely on the ______ of the ADT.
a. data members
b. structure
c. implementation
d. behavior
ANSWER
d.
, Question 12.
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
ANSWER
d
Question 13.
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
ANSWER
d.
Question 14.
14. An ADT's operations are known as its ______.
a. axioms
b. methods
c. variables
d. interfaces
ANSWER
b.
Question 15.
15. Encapsulation combines an ADT's data with its operations to form a(n) ______.
a. exception
b. method
c. object
d. variable
ANSWER
c.
QUESTIONS WITH CORRECT ANSWERS
Question 1.
1. The specifications of an ADT's operations indicate ______.
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
ANSWER
a.
Question 2.
2. Data structures are part of an ADT's ______.
a. definition
b. implementation
c. specifications
d. usage
ANSWER
b.
Question 3.
3. A(n) ______ allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
ANSWER
c.
,Question 4.
4. An ADT's ______ govern(s) what its operations are and what they do.
a. specifications
b. implementation
c. documentation
d. data structure
ANSWER
a.
Question 5.
5. When each module performs one well-defined task, we say that it is ___.
a. loosely coupled
b. highly coupled
c. cohesive
d. not easily reused
ANSWER
c.
Question 6.
6. When should an operation contract be written?
a. during analysis
b. after coding
c. at the same time as user documentation
d. when taking initial notes from client
ANSWER
a.
Question 7.
7. What information is included in the operation contract?
a. the method's interface
b. data flow among the modules
c. assumptions about input
d. all of these
ANSWER
d.
,Question 8.
8. What kind of interface contains a method if and only that method is essential to that class's
responsibilities?
a. complete
b. minimal
c. expanded
d. compact
ANSWER
b.
Question 9.
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
ANSWER
d.
Question 10.
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
ANSWER
b.
Question 11.
11. A client program depends solely on the ______ of the ADT.
a. data members
b. structure
c. implementation
d. behavior
ANSWER
d.
, Question 12.
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
ANSWER
d
Question 13.
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
ANSWER
d.
Question 14.
14. An ADT's operations are known as its ______.
a. axioms
b. methods
c. variables
d. interfaces
ANSWER
b.
Question 15.
15. Encapsulation combines an ADT's data with its operations to form a(n) ______.
a. exception
b. method
c. object
d. variable
ANSWER
c.