Question: Create a new project in Eclipse, following the lab guidelines. Create the following new Java classes, in the default package: ( Use these names exactly!

Create a new project in Eclipse, following the lab guidelines. Create the following new Java classes, in the default package: (Use these names exactly!)- Show.java - Person.java - CastMember.java - Role.java Lab1.java Place the given Lab1.java class in the default package within your project. Show.java This class will represent a Show object, which we will define as having: - A title, represented as a String (i.e.: Hamilton)- Cast members, stored as an array of CastMember objects (i.e. CastMember[])- A number of cast members, represented as an int (because it would be awkward to have \(0.5\) of someone!)- A toString() method, which calls upon the toString() method in CastMember.java to return as a String all needed information. - An addCastMember(..) method, which takes as a parameter a CastMember object and returns nothing. This class must have a constructor and getters and setters to accommodate its variables. Person.java This class will represent a Person object, which we will define as having: - A name, represented as a String - An age, represented as an int - A toString() method which returns a String representation of the person This class will be abstract, so that the CastMember and Role classes can implement further details. It should provide a constructor, getters, and setters.
Dish.java
This 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 vegetarian
A 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.java
These 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 needed
A toString() method, which returns a String representation of the dish by calling upon "getter" methods
A getType() method, fulfilling the requirements of the super class
An 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.java
These 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 needed
A getSubType() method that fulfills the requirements of the super class
Sample 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!