Question: please follow up the instructions java Write a Java program that will prompt the user for a purchase amount. If this bill amount is valid,

please follow up the instructions
java  please follow up the instructions java Write a Java program that

Write a Java program that will prompt the user for a purchase amount. If this bill amount is valid, then prompt the user again for the payment amount. If this is valid then compute the change to be returned. This amount should be displayed in pennies, nickels, dimes, quarters, single dollar bills, five-dollar bills, ten-dollar bills, and 20 dollar bills. If either of the input values are invalid, an error message should be displayed explaining precisely where the error is. Sample run number 1: This program will compute the proper change from a purchase. Please enter the purchase amount: $1.32 Please enter the payment amount: $20 The change is: 1 TEN(S) 1 FIVE(S) 3 ONE(S) 2 QUARTER(S) 1 DIME(S) I NICKEL(S) 3 PENNIES Sample run number 2: This program will compute the proper change from a purchase. Please enter the purchase amount: $-1 The purchase amount has an error! The purchase amount must be at least 1 cent. Sample run number 3: This program will compute the proper change from a purchase. Please enter the purchase amount: $7.32 Please enter the payment amount: $5 The payment amount has an error. Payment amount must be at greater than or equal to the purchase amount

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!