Question 1
(TCO 1) A class is a _____, which encapsulates _____ and _____.
| template; methods; behavior |
| programming language construct; attributes; behavior |
Question 2
(TCO 1) Which of the following would be a more appropriate choice for a method in a Dish class?
Question 3
(TCO 1) Which of the following statements is/are true?
| C. An interface of a class defines what messages an object can respond to. |
| B. The specific values of the attributes of an object represent the state of the object. |
| Only A, B, and D are true |
| A. A class is necessary to be defined before you can create an object. |
| D. Objects communicate through message passing. |
Question 4
(TCO 1) Which of the following would be a more appropriate choice for a data member in a Button class?
Question 5
(TCO 1) The property of _____ describes the packaging of state and behavior together in an object.
Question 6
(TCO 8) Most professional coding standards use _____ for class and method names.
| no specific naming convention |
Question 7
(TCO 1) Examine the ClockType class definition. How many class members does it contain? class ClockType { public : void setTime(int, int, int); int getTime(); void printTime(); private: int hr; int min; int sec; }
| An average of 5 because (7 + 3) / 2 = 5 |
Question 8
(TCO 1) Assume we have two objects of a class. How many copies of the class's attributes and methods exist in the instantiated objects?
| Two copies, each object has its own copy |
| Zero, the objects do not have attributes and methods |
| Only one copy, both objects always share it |
Question 9
(TCO 1) Both _____ and _____ allow for code reuse and the building of more complex systems.
| messaging; object behaviors |
| UML diagrams; serialization |
Question 10
(TCO 1) By default, all members of a class are _____.