Given the following list of classes, attributes and methods, - identify which it
ID: 674748 • Letter: G
Question
Given the following list of classes, attributes and methods,
- identify which items are classes, which items are attributes and which items are methods;
- identify which class each attribute and method belongs to; and
- suggest a class hierarchy given your list of classes.
*Note - no particular capitalization scheme is used in the list below to differentiate between classes, methods, and attributes.
LandOnStatue, NumberOfLegs, Height, ShoeSize, Eat, Animal, Speak, WingSpan, Age, Peck, Sleep, Horse, LengthOfMane, Move, BeakLength, LengthOfTail, Bird, SaddleUp
Explanation / Answer
class: Animal
attribute: Age, Height,NumberOfLegs, BeakLength,LandOnStatue
method:Eat, Speak, Sleep,
class: Horse
attribute: LengthOfMane, ShoeSize,SaddleUp, LengthOfTail
method: Move
class : Bird
attribute: WingSpan,
method:Peck
Here Animal class is Parent class.
Hourse and Bird are child class.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.