Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, need help with making the program MealData.txt Avocado Egg Rolls 6.00 Parmesan-crusted Chicken 19.75 Strawberry Shortcake Pizookie 8.25 BBQ Tri-Tip Sliders 12.95 Spicy Peanut

Hello, need help with making the program

image

MealData.txt

Avocado Egg Rolls

6.00

Parmesan-crusted Chicken

19.75

Strawberry Shortcake Pizookie

8.25

BBQ Tri-Tip Sliders

12.95

Spicy Peanut Chicken with Soba Noodles

17.25

Monkey Bread Pizookie

8.25

Bacon Jam Wings

16.25

Prime Rib

28.95

Pizookie Trio

11.95

Honey Sriracha Brussels Sprouts

7.95

Mandarin Orange-Glazed Pork Chop

21.95

Mini Pizookie

4.25


NOTE: You MAY NOT use arrays, ArrayLists or any other data structure for this assignment. You may not use String.split() for this assignment. Create a UML class diagram representing a restaurant Meal. The meal consists of an appetizer and the appetizer's price, an entre and the entre's price and a dessert and the dessert's price. The Meal has the capability to report the value of all attributes, the total cost of the meal (getTotalCost() added to the Meal class - returns the price of appetizer, entree and dessert) and the current state of the object (using the toString()). The Java program will read a data file consisting of a restaurant (BJ's Restaurant) meal's dishes with corresponding prices to create Meal objects. The data in the file looks like this (remember that there are 4 meals in the data file): appetizer appetizer price entre entre price dessert dessert price The "driver" will have methods for the following: Read data from the file to create ONE Meal object at a time, (the data file contains data for 4 meals) - the data file is organized by meal: appetizer followed by its price on the next line, entree followed by its price on the next line, dessert followed by its price on the next line. Display one Meal object at a time and its total, well formatted (if you format your output in the toString() this is relatively easy) An example run (this shows ONE Meal object, yours will have 4 meals, the tip is calculated on the total of all meals) The meal at BJ's Restaurant consists of: Avocado Egg Rolls Parmesan-crusted Chicken $6.00 $19.75 Strawberry Shortcake Pizookie $ 8.25 Total $34.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

A Survey of Mathematics with Applications

Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde

10th edition

134112105, 134112342, 9780134112343, 9780134112268, 134112261, 978-0134112107

More Books

Students also viewed these Programming questions