Question: Please provide script for MATLAB. Thank you. Write a program that determines the change given back to a customer in a self-service checkout machine of

Please provide script for MATLAB. Thank you.

Write a program that determines the change given back to a customer in a self-service checkout machine of a supermarket for purchases of up to $10. The program generates a random number between 0.01 and 10.00 and displays the number as the amount to be paid. The program then asks the user to enter his payment, which can be one $1 bill, one $5 bill, or one $10. If the payment is less than the amount to be paid, an error message is displayed. If the payment is sufficient, the program calculates the change and lists the bills and/or the coins that make up the change, which has to be composed of the least number of bills and coins. For example, if the amount to be paid is $2.33, and a $10 bill is entered as payment, then the change is: 1 $5 bill, 2 $1 bills, 2 quarters, 1 dime, 1 nickel, and 2 cents.

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!