Question: The following is to be done with Java. The directions are critical for the project, I know there are easier ways, but the project calls

The following is to be done with Java.

The directions are critical for the project, I know there are easier ways, but the project calls for the specifics to be followed please.

1) Create classes "MenutItem", "Dessert", "Drink", "Entree", "Menu", "Ticket", and "Driver".

2) "MenuItem" class is an abstract class that "Entree", "Dessert", and "Drink" classes will inherit from. This class needs three attributes: String name, double price, and String orderCode. The orderCode should be a two letter code that the user will enter to select an item. Each attribute should have the needed setters and getters. This class should have an abstract toString Method that will enforce all inheriting classes to implement.

3) "Dessert", "Drink", and "Entree" are concrete class that inherits from (Is-A) MenuItem. Dessert needs one attribute glutonFree and any extra setters and getters for new attributes. Drink is a concrete class that inherits from(Is-A) MenuItem, with 2 attributes: char size and boolean checkID, and any extra setters and getters for new attributes. Entree is a concrete class that inherits from(Is-A) MenuItem, with one attribute of boolean vegan and any extra setters and getters for new attributes.

4) "Menu" Concrete class that contains an Array of MenuItems(up to 20). This needs methods that: A) List all the items on the menu B) Add an item to the menu C) select and get an item from the menu by the orderCode.

5) "Ticket" A concrete class that contains an Array of MenuItems(up to 20). This class should have methods that: A) tab out: Print the current ticket to the screen and show the total of the items order B) View ticket: List the items being ordered C) Add Item: Adds an item to the ticket D) Delete Ticket: Deletes the ticket and starts a new one.

6) "Driver" This class should contain the main method. It should create a Menu and MenuItems(Make up the restaurant and items. Have at least 5 of each concrete items: Entree, Drink, Dessert) It should present a simple command line interface that allows the user to: A) Show the menu(list all menu items) B) Show the current ticket(List all items on the current Ticket) C)Total of the current ticket D) Add Item: Add an item to the current ticket( will show menu and query to user to input an orderCode) E)Delete Ticket: Delete a ticket F)Quit: Quit the program G) Help: Display useful commands.

Most of these commands will be calls to the methods that are built into the Menu and Order objects. The driver acts as a conductor keeping everything organized. The program should have a help option. Be sure not to forget any of the details.

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!