hclAmcat
Company
Programming
Program
Mary is making a database of animals in a zoo and their properties. Possible animals are Dog, lion and zebra, each one has as attribute isHerbivorous, color and isNocturnal.She uses the object oriented programming paradigm for this.How will she conceptualize the system?
Option A : class Animals; object: dog lion and zebra; data members : isHerbivorous, color and isNocturnal.
Option B: class: Animals; object: isHerbivorous, color and isNocturnal
Option C: classes: dog,lion and zebra; object: Animals; data members: isHerbivorous , color and isNocturnal.
Option D : None of these
Read Solution (Total 5)
-
- Answer is Option A
- 10 years agoHelpfull: Yes(6) No(1)
- i want answer for this
- 10 years agoHelpfull: Yes(0) No(0)
- why not option c? using three classes dog ,lion and zebra and accesing it through the object animal every class has distinct data members(like in this case distinct characteristics like herbivorous,color,nocturnal)?
- 6 years agoHelpfull: Yes(0) No(0)
- option A because one class is enough for all the animals
- 6 years agoHelpfull: Yes(0) No(0)
- option A is the answer
- 5 years agoHelpfull: Yes(0) No(0)
hclAmcat Other Question