3 18 Points Class Menuitem Defined Superclass Entree Side Salad Dessert 4 Classes Extend M Q37083156

3. [18 points] Class MenuItemis defined as the superclass for Entree, Side, Salad and Dessert(all these 4 classes extend MenuItem). As a result, the propertiesand getters/setters previously defined are moved to MenuItem.

See the following diagram. Implement the class MenuItem.

Menultem name: String - description: String calories: int price : double Menultem(name: String, desc: String, cal: int, price

Make Entree, Side, Salad and Dessert classes extend MenuItem (asindicated in the figure) and remove from them all properties andGetters/Setters. The properties name, description, calories are nowinherited.

Add the property price and the corresponding getter andsetter in the class MenuItem. Now all other

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.