Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions