Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- Create a java file (named it as Order.java) to provide definition of an Order class. The Order class should include at least the following

image text in transcribed

- Create a java file (named it as "Order.java") to provide definition of an "Order" class. The Order class should include at least the following order information: - Private instance variables: (1) order id, (2) list of foods that user ordered (both type and quantity, e.g., 1 chicken sandwich, 1 medium fry, and 1 medium coffee, (3) the unit price of each food (e.g., chicken sandwich: $4.99, medium fry: $1.99, medium coffee: $2.99). - Public methods: (1) at least one constructor, (2) get/set methods that provide public interfaces for instance variables, (3) calculate and return total amount, (4) calculate and return tax amount, and (5) calculate and return final bill amount. (6) a print method that print out all order related information as an invoice/receipt and display it in console. Note: You may add other attributes and methods in Order class, be creative. You may reuse/revise/expand this class as a starting point to start working on your project\#1. - Write another java file (named it as "OrderTest.java") to create a testing program (i.e. a class contains the main method). Use that program to create an array of three Order object instances (The array can be a static-sized array or a dynamic-sized array such as ArrayList). Use those Order objects and their methods to store user inputted order information, and calculate order, tax, and total final bill amount, and print out each order related information as an invoice/receipt and display it in console. - Apply good programming practices: use loops and develop separate methods for user inputs, order invoice calculation, and display order information. - The program should allow user to choose from at least two main dishes (e.g., chicken, beef), at least two sides (e.g., fries, chips), and at least two drinks (e.g., water, soda). When prompt user to place order, should display all available food options and food prices. For example, Choose one of the main dishes: Chicken (4.99), Beef (5.99)

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions