Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (TCO 4) Suppose class Child is derived from class Parent that was in turn der

ID: 3555347 • Letter: 1

Question

1. (TCO 4) Suppose class Child is derived from class Parent that was in turn derived from class GrandParent. The class Child is a _____ of GrandParent? (Points : 5)        Successor
       Forebearer
       Ancestor
       Descendant
       Indirect descendant

       Interfaces must implement a default constructor if even one multi-arg constructor is also implemented.
       Interfaces are defined and implemented inside an abstract class.
       Methods listed in an interface must be implemented when used by another class.
       At least one interface must be used in any inheritance hierarchy.

5. (TCO 7) Which of the following statements is/are true? (Points : 5)        Interfaces contain both implemented methods and constants.
       Abstract classes always contain at least one interface.
       Derived classes can inherit abstract methods.
       None of the above

       Detailed comments, addressing all aspects of the code
       Deep levels of nesting to ensure all situations are addressed
       Straightforward algorithms
       All of the above
       None of the above

9. (TCO 9) Which of the following allow a programmer to reduce the complexity of an object-oriented program? (Points : 5)        A. create each class in a separate file
       B. using packages as a container for logically related items
       Both A and B
       None of the above

       0
       1
       2
       3

Question 2. 2. (TCO 6) What is the result of overusing inheritance? (Points : 5)        System dependencies may be created.
       Unnecessary relationships may be created.
       Code may be harder to understand.
       All of the above

Explanation / Answer

1.Descendant

2.All the above

3.Geometric Shapes

4.Methods listed in an interface must be implemented when used by another class.

5.Derived classes can inherit abstract methods.

6.All of the above

7.Coupling is increased.

8.Detailed comments, addressing all aspects of the code

9.Both A and B

10. int getDayOfBirth() {return day;}

11.public abstract void displayResult();

12.2