1.(TCO 3)Which of the following about composition is true? a. Composition promotes code reuse. b. Class composition means a class contains objects from another class. c. Inheritance and composition can be used together. d. All of the above 2.(TCO 4)Which of the following is true about inheritance? a. Child classes are more generalized than their associated parent classes. b. Inheritance demonstrates the generalization/specialization relationship. c. Parent classes are more specialized than their associated child classes. d. Parent classes contain more functionality than child classes. 3.(TCO 4)Select the parent class. a. Automobile b. Convertible c. Minivan d. Sedan 4.(TCO 4)Which of the following is not a good example of a hierarchy that could be modeled by inheritance? a. Airplanes b. Geometric shapes c. Prime numbers d. Employees 5.(TCO 4)Which of the following examples represent(s) the “is-a” relationship in the parent/child format? a. dog/cat b. rectangle/circle c. checking account/saving account d. None of the above 6.(TCO 3)What is/are the reason(s) to use inheritance? a. Labor division b. Introducing modularity into program c. Reusing design d. All of the above 7.(TCO 3)If class B inherits from class A, which of the following statements is true? a. Class A has access to the methods and data members of class B. b. Class A has access to the methods and data members of class B and class B’s subclasses. c. Class B does not have access to the methods and data members of class A d. Class B has access to the public and protected methods and data members of class A. 8.(TCO 4)______ is the least secure member access specifier. a. Public b. Friend c. Private d. Protected 9.(TCO 4)_______ is based on the principle that knowledge of a general category can be applied to more specific objects. a. Polymorphism b. Encapsulation c. Information hiding d. Inheritance 10.(TCO 6)_______ is the ability to use the same expression to denote different operations depending on the type of object calling the expression. a. Inheritance b. Encapsulation c. Polymorphism d. Composition

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *