Could someone do this program for me, could you please at a main
class where i will test the program.
1 RESTAURANT PROJECT This Restaurant only sells beverages and dishes as combos. 1.1 BEVERAGE CLASS 1.1.1 Data Members 1. String beverageld: the ID of the beverage 2. String beverageName: the name of the beverage Page 2 of 7 3. double price: the price of the beverage 4. int volume: the volume of the beverage 1.1.2 Static Variable 1. int nextId: the ID of the next beverage 1.1.3 Methods 1. Default constructor: beverageld should use generateld() 2. Constructor with beverageName, price, and volume as parameters. beverageld should use generateld method 3. Copy Constructor 4. generateld method: to generate beverage IDs. a. The formatting for the first beverage should be as follows: B001. b. The value should increase by one every time a beverage is created. 5. calcPrice method: This method calculates the price of the beverage based on the volume: a. If the volume is bigger than 500 mL, the price should be returned directly. b. Otherwise, the price should be multiplied by 0.6. 6. equals method (overloaded version) 7. toString: the formatting should be as follows:
3. double price: the price of the beverage 4. int volume: the volume of the beverage 1.1.2 Static Variable 1. int nextId: the ID of the next beverage 1.1.3 Methods 1. Default constructor: beverageld should use generateldo) 2. Constructor with beverageName, price, and volume as parameters. beverageld should use generateld method 3. Copy Constructor 4. generateld method: to generate beverage IDs. a. The formatting for the first beverage should be as follows: B001. b. The value should increase by one every time a beverage is created. 5. calcPrice method: This method calculates the price of the beverage based on the volume: a. If the volume is bigger than 500 mL, the price should be returned directly. b. Otherwise, the price should be multiplied by 0.6. 6. equals method (overloaded version) 7. toString: the formatting should be as follows: Beverage ID Beverage Name Beverage Price Beverage : B001 : Diet Coke : $2.00 : 500 Note: this pattern should be followed for all of the toString methods that follow. 8. getter and setter 1.2 DISH CLASS 1.2.1 Data Members 1. String dishid: the ID of the dish 2. String dishName: the name of the dish 3. char size: the size of the dish. Can be 'x', T', 'm', or 's'. 4. double price: the price of the dish 5. boolean spicy: is the dish spicy or not 1.2.2 Static Variable 1. int nextId: the ID of the next dish 1.2.3 Methods 1. Default constructor: dishid should use generateld method 2. Constructor with dishName, size, price, and spicy as parameters. beverageld should use generateld method 3. Copy Constructor Page 3 of 7
4. generateld method: to generate dish IDs. a. The formatting for the first dish should be as followed: D001. b. The value should increase by one every time a dish is created. 5. calcDishPrice method to calculate the price of a dish based on the size. a. If the size is extra-large, the price should be multiplied by 1.2. b. if it's large, the price should be returned directly. c. If it's medium, it should be multiplied by 0.6 d. If it's small, it should be multiplied by 0.4. 6. equals method (overloaded version) 7. toString: You should add a line for "Spicy: Spicy" or "Spicy: Not Spicy" based on the boolean. D001 : Fried Chicken Dish ID Dish Name Dish Size Dish Price Spicy - $20.00 Spicy 8. getter and setter 1.3 COMBO CLASS 1.3.1 Data Members 1. Dish dish: a dish 2. Beverage beverage: a beverage 1.3.2 Methods 1. Default constructor 2. Constructor with dish and beverage as parameters 3. Copy Constructor 4. calcComboPrice method to calculate the total price of the combo without tax and tips. a. The price of the dish and the beverage should be multiplied by 0.9. 5. equals method (overloaded version) 6. toString Dish: : 0001 • Fried Chicken Dish ID Dish Name Dish Size Dish Price Spicy $20.00 • Spicy Beverage: Beverage ID Beverage Name Beverage Price Beverage : B001 • Diet Coke : $2.00 • 500 7. getter and setter
1.4 CUSTOMER CLASS 1.4.1 Data Members 1. String customerld: the ID of the customer 2. String name: the name of the customer 3. int vipLevel: the VIP level of the customer. Can be 0, 1, 2, or 3. 4. int point the amount of points the customer has 1.4.2 Static Variable 1. int nextld: the ID of the next customer 1.4.3 Methods 1. Default constructor: customerld should use generateld() 2. Constructor with name, vipLevel and point as parameters, customerid should use generateld() 3. Copy Constructor 4. generateld method: to generate customer IDs. a. The formatting for the first customer should be as followed: C001. b. The value should increase by one every time a customer is created. 5. updateVip method: To update the VIP level of a customer. a. To go from level 0 to 1, the customer should use 50 points. b. From 1 to 2, the customer should use 80 points. C. From 2 to 3, the customer should use 100 points. d. Anything else should be returned as false. 8. equals method (overloaded version) 6. toString Customer ID : 0001 Nane : John Vip Level : 2 Points : 700 7. getter and setter 1.5 TAX CLASS 1.5.1 Data Members 1. double fedTax: the federal tax 2. double proTax: the provincial tax 3. double totalTax: the total tax 1.5.2 Methods 1. Default constructor 2. Constructor with fedTax, proTax, and totalTax as parameters 3. Copy constructor 4. equals method (overloaded version) 5. toString Pag of 7
Fed Tax Pro Tax Total Tax : $1.13 : $2.27 : $3.40 6. getter and setter 1.6 BILL CLASS 1.6.1 Data Members 1. Combo combo: a combo 2. Customer customer: a customer 3. double original Price: the original price 4. double discountedPrice: the price with a discount 5. Tax tax: the tax 6. double finalPrice: the final price 1.6.2 Methods 1. Default constructor 2. Constructor with dish, beverage, and customer as parameters. a. The combo object should be created using the dish and beverage. b. The original price should be the combo price. C. The discounted price should be called from the calcPriceWith Discount() method. d. The tax should be called from the calcTax() method. e. The final price should be called from calcFinal Pricel). 3. Copy Constructor 4. calcPrice With Discount method: To calculate the price after applying the discount based on the customer's VIP level. a. If the vipLevel is 0, or if the customer is null, the combo price should be returned directly. b. If the level is 1, discounted price should be the combo price times 0.95. c. If the level is 2, it should be combo price times 0.9. d. If the level is 3, it should be combo price times 0.85. 5. calcTax method: To calculate the tax of the meal. a. The federal tax should be multiplied by 0.05 b. The provincial tax should be multiplied by 0.1. C. The tax object should then be updated with these new values. 6. calcFinal Price method: To calculate the final price of the meal. It should be the discountedPrice plus the total tax. 7. updatePoints method: To update the points of a customer. For each 10$ spent, the customer gets a point. 8. equals method (overloaded version) 9. toString: should include combo, customer original price, discounted price, federal tax, provincial tax, total tax, and final price Page 6 of 7
Dish: Dish ID Dish Name Dish Size Dish Price Spicy : D001 : Fried Chicken : x : $20.00 : Spicy Beverage: Beverage ID Beverage Name Beverage Price Beverage : B001 : Diet Coke : $2.00 : 500 Customer Original Price Discounted Price Fed Tax Pro Tax Total Tax : 1001 - L2 : $22.68 : $20.41 : $1. 13 : $2.27 : $3.40 Final Price • $23.81 10. getter and setter
Could someone do this program for me, could you please at a main class where i will test the program.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Could someone do this program for me, could you please at a main class where i will test the program.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!