1. (TCO 3) Composition represents what kind of relationship? (Points : 2) has -
ID: 3846084 • Letter: 1
Question
1. (TCO 3) Composition represents what kind of relationship? (Points : 2) has - ais - a
uses - a
None of the above Question 2. 2. (TCO 4) Which of the following terms can be used to describe inheritance relationships between classes? (Points : 2) Parent/child
Super/sub
Base/derived
All of the above Question 3. 3. (TCO 4) Select the parent class. (Points : 2) Circle
Shape
Cylinder
Rectangle Question 4. 4. (TCO 4) Which of the following is not a good example of a hierarchy that could be modeled by
inheritance? (Points : 2) Airplanes
Geometric shapes
Animals
Prime numbers Question 5. 5. (TCO 4) Which of the following examples represent the "is-a" relationship in the parent/child format? (Points : 2) airplanes/jet
shapes/circle
person/student
All of the above Question 6. 6. (TCO 3) What is the result of over-using inheritance? (Points : 2) System dependencies are created.
Unnecessary relationships are created.
Code is harder to understand.
All of the above Question 7. 7. (TCO 3) In object-oriented programming, inheritance is transitive; that means a child class _____. (Points : 2) inherits only from its parent class
inherits only selected methods and fields
inherits all the methods and fields of all its ancestors
does not inherit any methods or fields Question 8. 8. (TCO 4) _____ is the least secure member access specifier. (Points : 2) Public
Friend
Private
Protected Question 9. 9. (TCO 4) Inheritance is only possible in _____ languages. (Points : 2) procedural
object-oriented
GUI based
non-structured Question 10. 10. (TCO 6) Which of the following is/are benefit(s) of using inheritance? (Points : 2) Smaller chance of errors
Ease of use for users of class
Time saving
All of the above 1. (TCO 3) Composition represents what kind of relationship? (Points : 2) has - a
is - a
uses - a
None of the above Question 2. 2. (TCO 4) Which of the following terms can be used to describe inheritance relationships between classes? (Points : 2) Parent/child
Super/sub
Base/derived
All of the above Question 3. 3. (TCO 4) Select the parent class. (Points : 2) Circle
Shape
Cylinder
Rectangle Question 4. 4. (TCO 4) Which of the following is not a good example of a hierarchy that could be modeled by
inheritance? (Points : 2) Airplanes
Geometric shapes
Animals
Prime numbers Question 5. 5. (TCO 4) Which of the following examples represent the "is-a" relationship in the parent/child format? (Points : 2) airplanes/jet
shapes/circle
person/student
All of the above Question 6. 6. (TCO 3) What is the result of over-using inheritance? (Points : 2) System dependencies are created.
Unnecessary relationships are created.
Code is harder to understand.
All of the above Question 7. 7. (TCO 3) In object-oriented programming, inheritance is transitive; that means a child class _____. (Points : 2) inherits only from its parent class
inherits only selected methods and fields
inherits all the methods and fields of all its ancestors
does not inherit any methods or fields Question 8. 8. (TCO 4) _____ is the least secure member access specifier. (Points : 2) Public
Friend
Private
Protected Question 9. 9. (TCO 4) Inheritance is only possible in _____ languages. (Points : 2) procedural
object-oriented
GUI based
non-structured Question 10. 10. (TCO 6) Which of the following is/are benefit(s) of using inheritance? (Points : 2) Smaller chance of errors
Ease of use for users of class
Time saving
All of the above
Explanation / Answer
1. Composition represents what kind of relationship? => Has-A
2. Which of the following terms can be used to describe inheritance relationships between classes? => All of the above
3. Select the parent class.: Shape, Shape is parent because all other classes are child classes of Shape.
4. Which of the following is not a good example of a hierarchy that could be modeled by
inheritance?=> Prime numbers
5. Which of the following examples represent the "is-a" relationship in the parent/child format? => All of above
6. What is the result of over-using inheritance? => All of above. When inheritance is overused, we create system dependencies,unnecessary relationships, and harder to use code.
7. In object-oriented programming, inheritance is transitive; that means a child class inherits all the methods and fields of all its ancestors
8. Public is the least secure member access specifier.
9. Inheritance is only possible in object-oriented languages.
10. Which of the following is/are benefit(s) of using inheritance? => All of above
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.