Question

In: Computer Science

Give an example of a three-level "Is-A" hierarchy and a three-level "Has-A" hierarchy other than the...

Give an example of a three-level "Is-A" hierarchy and a three-level "Has-A" hierarchy other than the ones discussed in the lecture.



Just provide as many examples as you can,
thank you

Solutions

Expert Solution

In hierarchical model, data is organized into a tree like structure with each record is having one parent record and many children. The main drawback of this model is that, it can have only one to many relationships between nodes.

An IS-A relationship is inheritance. The classes which inherit are known as sub classes or child classes. On the other hand, HAS-A relationship is composition.

In object-oriented programming, the concept of IS-A is a totally based on Inheritance, which can be of two types Class Inheritance or Interface Inheritance. It is just like saying "A is a B type of thing". For example, Apple is a Fruit, Car is a Vehicle etc. Inheritance is uni-directional. For example, House is a Building. But Building is not a House.

Composition(HAS-A) simply mean the use of instance variables that are references to other objects. For example Maruti has Engine, or House has Bathroom.


Related Solutions

Please give one example for each level of the fair value hierarchy.
Please give one example for each level of the fair value hierarchy.
Give an example other than a source of praise of something that could be an extrinsic...
Give an example other than a source of praise of something that could be an extrinsic source of self-esteem for AN ADULT and then give an example of something that could be an intrinsic source.
Define Incremental Analysis in the evaluation of ROR, and give an example (other than the examples...
Define Incremental Analysis in the evaluation of ROR, and give an example (other than the examples in the slides or the
Describe and define Maslow’s Hierarchy of Needs. Include in each level how it affects the other...
Describe and define Maslow’s Hierarchy of Needs. Include in each level how it affects the other level with a person’s motivation. Then compare Maslow’s Hierarchy of Needs with the comparison of Utilitarianism vs hedonic products in fulfilling needs and wants.
Can you please give an original example of a application integration hierarchy and explain it for...
Can you please give an original example of a application integration hierarchy and explain it for me; you can give one or up to 3 design examples (i.e., data sharing, functionality sharing, or process coordination).
Give an example of a linear system of three equations with three unknowns that has the...
Give an example of a linear system of three equations with three unknowns that has the general solution with one parameter.
Give an example of a cubic polynomial with zero discriminant (other than x^3=0). Moreover, show that...
Give an example of a cubic polynomial with zero discriminant (other than x^3=0). Moreover, show that the discriminant is zero when two roots coincide.
what is forecasting inventory level? give an example?
what is forecasting inventory level? give an example?
Give an example of Altruism on a macro level, and micro level, and how the concept...
Give an example of Altruism on a macro level, and micro level, and how the concept would be used to understand an issue involving a large group (macro-level) and small group (micro-level). 500 words
what is disintermediation?think of an example(other than those given in the chapter)of a company that has...
what is disintermediation?think of an example(other than those given in the chapter)of a company that has been disintermediated and one that has disintermediated another type of company. Do you think bricks-and-mortar retailers will ever be completely distintermediated?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT