Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA**** Please select a menu item from the list below: 1 View item menu 2 Pay total due 3 Add $5 in credit 4

IN JAVA****

Please select a menu item from the list below:

1 View item menu

2 Pay total due

3 Add $5 in credit

4 Clear order

The user can input a numerical menu option between 1 and 4. If an incorrect entry is inputted then the program will print.

Please enter a valid option!

display food options to the user. The user can input a numerical menu option between 1 and 5.

(1) Toaster: $19.99

(2) Coffee maker: $29.49

(3) Waffle maker: $15.79

(4) Blender: $24.99

(5) Kettle: $$24.99

(6) Go to the main menu

Your current total is: $0.00

If an incorrect entry is inputted then the program will print.

Invalid item number please try again

This menu will loop until the user enters option 6 which will bring them back to the main menu. When the user inputs an option between 1 and 5 the program will display a confirmation of the selected item. Make sure that each corresponding menu option prints the exact confirmation format listed below:

You have added a Toaster to your order.

You have added a Coffee maker to your order.

You have added a Waffle maker to your order.

You have added a Blender to your order.

You have added a Kettle to your order.

Below is an example of the console output when the user chooses item 1 and then 2 (note that the input is not visible in the output).

What would you like to add to your order?

(1) Toaster: $19.99

(2) Coffee maker: $29.49

(3) Waffle maker: $15.79

(4) Blender: $24.99

(5) Kettle: $24.99

(6) Go to the main menu

Your current total is: $0.00

You have added a Toaster to your order.

What would you like to add to your order?

(1) Toaster: $19.99

(2) Coffee maker: $29.49

(3) Waffle maker: $15.79

(4) Blender: $24.99

(5) Kettle: $24.99

(6) Go to the main menu

Your current total is: $19.99

You have added a Coffee maker to your order.

What would you like to add to your order?

(1) Toaster: $19.99

(2) Coffee maker: $29.49

(3) Waffle maker: $15.79

(4) Blender: $24.99

(5) Kettle: $24.99

(6) Go to the main menu

Your current total is: $49.48

  • 2 Pay total due: This option allows the user to pay the amount that is due before tax is added. For the total amount to pay all goods are taxed at 8.5%. In addition, the store offers a 20% discount if the total before taxes is greater than $50. Discount will be applied before taxes are added.The user will start from an initial budget of $100 and if the user is able to afford the total payment (incl. of taxes) then the purchase will go through and the user will see the following text:

Your total due is: $49.48

Thank you! Your change is: $46.31

Your items will be on their way soon!

Here is another example output for when the user has received the discount and the system should also show the savings in the output:

Your total due is: $70.27

Thank you! You saved: $11.24 Your change is: $39.01

Your items will be on their way soon!

If the user cannot afford the purchase they will received the following console text and exit the program:

Insufficient funds!

  • 3 - Add $5 in credit: This option increments the available credit by $5, and prints the new available credit (with 2 digits precision):

Credit available: $

  • 4 Clear order: This menu option will reset the total balance due to $0 and show the following:

Current order balance has been cleared. Current due: $0.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

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago