Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
100%

Use matlab to determine the answer. Use the function file then call the function to get the answer in a script file.

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 $20. The program generates a random number between 0.01
and 20.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, or one $20 bill. 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 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.
expand button
Transcribed Image Text: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 $20. The program generates a random number between 0.01 and 20.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, or one $20 bill. 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 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.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education