Question 1 2 pts (TCO 3) Inheritance represents what kind of relationship? has -
ID: 3866219 • Letter: Q
Question
Question 1
2 pts
(TCO 3) Inheritance represents what kind of relationship?
has - a
uses - a
is - a
None of the above
Question 2
2 pts
(TCO 4) Which of the following terms can be used to describe inheritance relationships between classes?
Parent/child
Super/sub
All of the above
Base/derived
Question 3
2 pts
(TCO 4) Select the parent class.
Person
Manager
Executive
Staff
Question 4
2 pts
(TCO 4) Which of the following is not a good example of a hierarchy that could be modeled by
inheritance?
Prime numbers
Airplanes
Geometric shapes
Animals
Question 5
2 pts
(TCO 4) Which of the following examples represent the "is-a" relationship in the parent/child format?
All of the above
person/employee
person/student
student/international student
Question 6
2 pts
(TCO 3) What is the result of over-using inheritance?
All of the above
Code is harder to understand.
Unnecessary relationships are created.
System dependencies are created.
Question 7
2 pts
(TCO 3) Which of the following are true about composition?
Associations and aggregations should be used together in composition.
The system should be highly dependable.
The type of composition only includes associations, and excludes aggregations.
Only inheritance can be represented using UML; composition cannot be represented using UML.
Question 8
2 pts
(TCO 4) _____ is the least secure member access specifier.
Friend
Private
Public
Protected
Question 9
2 pts
(TCO 4) Inheritance is only possible in _____ languages.
GUI based
procedural
object-oriented
non-structured
Question 10
2 pts
(TCO 6) The whole list of parent classes from which a child class is derived constitutes the _____ of the child class
role
subset
ancestors
family
Explanation / Answer
Question 1 Ans)
Inheritance represents an "is-a" relationship ( answer is option 3)
Question 2 Ans )
Answer is All of the above ( option 3)
Parent/child -- Child class inherits functionality from parent class
super/sub --- sub class inherits functionality from super class
Base/Derived --- Derived class inherits functionality from Base class
So answer is All of the above (option 3).
Question 3 ) Ans :
Parent class is Person , i.e is option 1 because from person , manager, executive and staff are derived.
Question 4) Ans :
Prime Numbers is not a good example of a hierarchy that could be modeled by inheritance.
Prime numbers cannot be extended to accommodate future child classes
So answer is option 1 ( Prime numbers)
Question 5) Ans:
As inheritance represents an "Is-A" relationship, answer is " All of the Above" (option 1)
person/employee -- represents parent/child relationship
person/student --- represents parent/child relationship
student/international student --- represents parent/child relationship
So answer is all of the above(option 1)
Question 6) Ans :
Answer is All of the above (option 1)
When inheritance is overused, we create system dependencies, unnecessary relationships, and harder to use code.
Question 7) Ans:
The system should be highly dependable in composition ( i.e option 3)
Question 8) Ans:
From most protection to least, the order of inheritance is private < protected< public.
So Answer is Public (option 3)
Question 9) Ans :
Only Object oriented language supports inheritance.
So answer is object-oriented( option 3)
Question 10) Ans:
As child classes are derived from list of parent classes. So parent classes contains " Ancestors" of the child class
So answer is ancestors (option 3)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.