Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 303 Weeks Ago, 3 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Management Posted 28 Jan 2018 My Price 9.00

Java Interfaces and Multiple Inheritance

13.4  Java Interfaces and Multiple Inheritance

In C++, a derived class may have multiple base classes. In contrast, a Java derived class may only have one base class but may implement more than one interface. This question asks you to compare these two language designs.

(a)     Draw a C++ class hierarchy with multiple inheritance using the following classes:

Pizza, for a class containing all kinds of pizza,

Meat, for pizza that has meat topping,

Vet, for pizza that has vegetable topping, Sausage, for pizza that has sausage topping, Ham, for pizza that has ham topping, Pineapple, for pizza that has pineapple topping,

Mushroom, for pizza that has mushroom topping,

Hawaiian, for pizza that has ham and pineapple topping.

 

For simplicity, treat sausage and ham as meats and pineapple and mushroom as vegetables.

(b)     If you were to implement these classes in C++ for some kind of pizza- manufacturing robot, what kind of potential conflicts associated with multiple inheritance might you have to resolve?

(c)     If you were to represent this hierarchy in Java, which would you define as interfaces and which as classes? Write your answer by carefully redrawing your picture, identifying which are classes and which are interfaces. If your program creates objects of each type, you may need to add some additional classes. Include these in your drawing.

(d)     Give an advantage of C++ multiple inheritance over Java classes and interfaces and one advantage of the Java design over C++.

 

Answers

(5)
Status NEW Posted 28 Jan 2018 09:01 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------

Not Rated(0)