Question: Java Help _________________________________________ Implement the ULM diagram above. Separate files for each class. Each class with a constructor and toString() method. toString() will return a

Java Help

_________________________________________Java Help _________________________________________ Implement the ULM diagram above. Separate files for each

Implement the ULM diagram above. Separate files for each class. Each class with a constructor and toString() method. toString() will return a String with the labeled variables of each member variables.

The constructor will accept the name as an argument (as many arguments). Use super() to call the base class constructor and pass up the name.

From each of the 3 subclasses above derive 2 classes of your own. You can choose to add more member variables or just use the inherited from the parent classes. Provide each class with a constructor that sets of all the member variables, both local and inherited. Use super() to pass the name up the base class constructor.

In main() create an array of 6 items. Assign each element an object from each of your classes. Use a for loop to call toString() on all 6 elements. Display the Strings as they are returned.

Example

Class chocolateCake extends Dessert {

ChocolateCake () {

super(Chocolate Cake);

price = 4.99f;

}

}

Item name description price calories String String float int Item(String name) toString Beverage Entre Dessert sugarFree bool hot alcoholic oz Sizes size bool bool float enum Sizes vegetarian Category category bool enum Catagory Entree(String name) toString Dessert(String name) toString Beverage(String name) toString

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!