Question: Write a Java console application that computes the change of a purchase transaction. The console application will produce only the following: Prompt the user for

Write a Java console application that computes the change of a purchase transaction. The console application will produce only the following:

Prompt the user for a purchase amount

Prompt the user for the amount of money tendered

Validate that the purchase amount is less than or equal to the amount tendered, if not, do not let the user continue until this business rule is followed by the user. Produce a message to the user when this rule is broken

From the difference between the purchase amount and the amount tendered, calculate the amount of cents in change

i. Example

1. Purchase is $3.50, the amount tendered is $5.00, calculate the coins on $0.50

Produce a message which reports the number of quarters, dimes, nickels and pennies that will be issued in the change from a purchase

i. Example

1. For a purchase amount of $56.57, the amount tendered is $60.00, calculate the coins on $0.43 and the message produced will be

Use looping to calculate the coins

If no coins are to be issued, produce a message to the user

i. Example

1. For a purchase amount of $60.00, the amount tendered is $60.00

a. Produce a message No coins to issue

Use big decimal for the user inputs

Prompt the user after the calculation if they wish to execute another transaction. Prompt the user for y or n. If the user enters y, begin the application from the start of the workflow, if n exit the application.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!