Question
Question set 5: ( Java ) Object Oriented- 1. Create a class called Car. The class should have the following three instance variables: make(String), speed(double),
Question set 5: ( Java ) Object Oriented-
1. Create a class called Car. The class should have the following three instance variables: make(String), speed(double), and year(String). Write a constructor to allow objects to be created with these three initial values. Also write all the getter, setter and toString() methods. Write a Demo class to create three Car objects with some meaningful initial values and display them using the toString()method.
2. Create a class called Order. The class should include the following three fields:a.Item description (e.g., Beef Skillet)b.Quantity (e.g., 1 or 2, etc.)c.Unit price (e.g., 9.99)
Write a Demo class. In this Demo class, you will create at least the following four methods:a.showMenu():It will display a Restaurant menu sort of like the one shown below.b.create Order():It will allow the user to pick menu items (e.g., E2) and quantity using a Scanner object. Each item and its quantity picked, together with its unit price, will be used to create an Order object. A user can pick as many items as he/she wants. This will create an equal number of Order objects. These Order objects will be stored in an array as they are created.c.showCheck(): It will display a receipt based on the orders made by the user. It will show something like the following
Using the below piece as reference for food choices:
Seoul Restaurant (631) 123-4567 SERVER: John Doe Item Item Description Qty Unit Price Amount 1. 2. Beef Skillet Steak 9.99 15.99 19.98 15.99 Subtotal Tax (8.0625%) Total 35.97 3.10 39.07 d. main(String[] args): integrate the above methods and allow multiple users to place orders in sequence (you need a while-loop here). Korean Cuisine SEOUL RESTAURANT 2625 North Hillfield Road Layton, UT 84041 (801)776-7066 Korean Dishes 9.99 E1 Kalbi 14.99 (Extra Meat) -4.00 E2 Special Box - (Chicken / Beef / Pork) 11.99 (Comes w/ mandu 4 Pieces, Half California Roll) E3 Jopche 8.99 Beef Skillet 10.99 E5 Bi Bim Bop E6 Bulkogi 9.49 (Extra Meat) *3.00 Pork Bulkogi E8 Hot Spicy Chicken 899 (Extra Meat) 2.00 E9 Hot Spicy Squid or Pork E10 Yook Ke Jang 9.99 8.99 9.99Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started