Using Java Two C, create a class called Order (ex: p351) that has the following fields:
entree A char that holds the person’s burger order
drink A char that holds the person’s drink order
dessert A char that holds the person’s dessert order
The class should have the following methods defined:
default constructor – Sets all values to blank
Constructor#2 – Accepts an order’s entrée, drink, and dessert selection
setEntree – Accepts a char argument that is copied to the entrée field
setDrink – Accepts a char argument that is copied to the drink field
setDessert – Accepts a char argument that is copied to the dessert field
getEntree – Returns the value in entrée
getDrink – Returns the value in drink
getDessert – Returns the value in dessert
getPrice Returns the price of the three items in the order
Write a demo program (ex: HARDYL_J5D) that instantiates three people’s orders. Allow the user to enter the orders. Display each person’s order price and a total for the entire bill.
Person #1 $7.00
Person #2 $8.50
Person #3 $10.25
Your output can look like the example, or you can change it, but make it clear. For example, you might have a column heading for Person and put #1 under the heading.
You can also use different field & method names but call your class Order.
You do not have to return the description for the selections.
Get price will have the same code used in Java 2D, except for description
The demo program will have similar code to Java 2D, but you do it 3 times.
Don’t worry about validating the input values (you should in business, but I don’t want this to be too complicated/time-consuming for you).
Be sure your demo program tests all methods of the class. For one person, get all the values and pass them all back. For another person, instantiate the order, then set the individual values one at a time.
When formatting output, you might have to use multiple tabs (t) to align the data.
It took me about 35 minutes
Doesn’t create Order class -10 (no credit for this part of the assignment)
Doesn’t create a Demo program -5
Doesn’t have all the class fields -1/per field (3)
Doesn’t have all the class methods -.5/per method (9)
Doesn’t calculate price -2
Doesn’t display results -3
Doesn’t display correct total -1