Question: Create the following new Java classes, in the default package: ( Use these names exactly! ) Restaurant . javaDish.java - This will be an interfaceAppetizer.java

Create the following new Java classes, in the default package: (Use these names exactly!)Restaurant.javaDish.java - This will be an interfaceAppetizer.java - This will be an abstract class, 1 of 3 types of DishMainCourse.java - This will be an abstract class, 1 of 3 types of DishDessert.java - This will be an abstract class, 1 of 3 types of DishSalad.java - This will be a class, 1 of 2 types of AppetizerSoup.java - This will be a class, 1 of 2 types of AppetizerSteak.java - This will be a class, 1 of 2 types of MainCoursePasta.java - This will be a class, 1 of 2 types of MainCourseCake.java - This will be a class, 1 of 2 types of DessertIceCream.java - This will be a class, 1 of 2 types of DessertThe relationships between these classes are as follows:A Restaurant contains (has-a) Dishes.There are 3 types of ('is-a') Dishes: Appetizers, Main Courses, and Desserts.Salad and Soup are types of Appetizer.Steak and Pasta are types of Main Course.Cake and IceCream are types of Dessert.Restaurant.javaThis class will represent a Restaurant object, which we will define as having:A name, represented as a String (e.g., "Gusteau's")A max count of dishes on the menu, represented as an int (e.g., in Lab1.java, the count is set to 10)Dishes, stored as an array of Dish objects (e.g., Dish[])A constructor that initializes all instance variables, and any other constructors as neededAn addDish() method, which takes a Dish object as a parameter and returns nothingA toString() method, which calls upon the toString() method in Dish.java to return all needed information as a String (see the output below).Getters and setters for all variablesDish.javaThis class will represent a Dish, defined as an interface. This interface should declare the following methods (for the subclasses to implement):A method isVegetarian(), which takes no parameters and returns a boolean indicating whether or not the dish is vegetarianA getName() method, which takes no parameters and returns a String of the dishs name (e.g., "Caesar Salad")A getType() method, which takes no parameters and returns a String of the dishs type (e.g., "Appetizer")A toString() method, which returns a String representation of the dish (see the output below)Appetizer.java, MainCourse.java, Dessert.javaThese classes will be abstract, representing the types of dishes on the menu. Each class should implement the Dish interface and have:A name, represented as a String (e.g., "Lobster Bisque")Whether or not the dish is vegetarian, represented as a boolean (e.g., false for Steak)A constructor that initializes all instance variables, and any other constructors as neededA toString() method, which returns a String representation of the dish by calling upon "getter" methodsA getType() method, fulfilling the requirements of the super classAn abstract method getSubType(), which takes no parameters and returns a sub-type of dish (e.g., "Salad"). Salad.java, Soup.java, Steak.java, Pasta.java, Cake.java, IceCream.javaThese classes will be concise, representing the specific types of dishes that can be added to the menu. Each class should extend its respective abstract class and have:A constructor that initializes all instance variables, and any other constructors as neededA getSubType() method that fulfills the requirements of the super classSample Output:Welcome to Gusteau's Restaurant!-------------* Appetizer: Salad named Caesar Salad (vegetarian)* Appetizer: Soup named Lobster Bisque (not vegetarian)* Main Course: Steak named Ribeye Steak (not vegetarian)* Main Course: Pasta named Fettuccine Alfredo (vegetarian)* Dessert: Cake named Chocolate Cake (vegetarian)* Dessert: Ice Cream named Vanilla Ice Cream (vegetarian)

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 Programming Questions!