Write a program that models a cashier at a store. The program will take two numbers as input. Firstly, the cost of an item ($20.00 or less). Secondly, the amount of money given to the cashier ($20.00 or less). The program should output the change given in 10 dollar bills, 5 dollar bills, 1 dollar bills, quarters, dimes, nickels, or pennies. You should output the highest denominations possible. For example, if the item costs $5.20 and the cashier is given $10 then the change should be

Glencoe Algebra 1, Student Edition, 9780079039897, 0079039898, 2018
18th Edition
ISBN:9780079039897
Author:Carter
Publisher:Carter
Chapter3: Linear And Nonlinear Functions
Section3.7: Piecewise And Step Functions
Problem 30PPS
icon
Related questions
Topic Video
Question

2. Write a program that models a cashier at a store. The program will take two numbers as input. Firstly, the cost of an item ($20.00 or less). Secondly, the amount of money given to the cashier ($20.00 or less). The program should output the change given in 10 dollar bills, 5 dollar bills, 1 dollar bills, quarters, dimes, nickels, or pennies. You should output the highest denominations possible. For example, if the item costs $5.20 and the cashier is given $10 then the change should be

 

4 dollar bills

3 quarters

1 nickle

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Optimization
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, calculus and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
Algebra and Trigonometry (MindTap Course List)
Algebra and Trigonometry (MindTap Course List)
Algebra
ISBN:
9781305071742
Author:
James Stewart, Lothar Redlin, Saleem Watson
Publisher:
Cengage Learning
College Algebra
College Algebra
Algebra
ISBN:
9781938168383
Author:
Jay Abramson
Publisher:
OpenStax
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Elementary Geometry for College Students
Elementary Geometry for College Students
Geometry
ISBN:
9781285195698
Author:
Daniel C. Alexander, Geralyn M. Koeberlein
Publisher:
Cengage Learning