Question: This is a matlab question i need help with this. i can't get it to work Write a program that determines the change given back

 This is a matlab question i need help with this. i

This is a matlab question i need help with this. i can't get it to work

Write a program that determines the change given back to a customer in a self-service checkout machine of supermarket for purchases of up to $50. The program generates a random number between 0.01 and 50.00 and displays the number as the amount to be paid. The program then asks the user to enter payment, which can be one $1 bill, one $5 bill, one $10 bill, one $20 bill, or one $50 bill. If the payment is less than the amount to be paid, an error 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 each 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 one $5 bill, two $1 bills, two quarters, one dime, one nickel, and two pennies. Execute the program three times. Answer: The amount to be paid is: $13.93 Please enter payment in dollars (1, 5, 10, 20 or 50) 20 The change is: 0 $20 bills 0 $10 bills 1 $5 bills 1 $1 bills 0 quarters 0 dimes 1 nickels 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!