Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in medium-level psuedocode 18. Design an algorithm for the following problem: You are a cashier in a candy store. Each of your customers buys

write in medium-level psuedocode image text in transcribed
image text in transcribed
18. Design an algorithm for the following problem: You are a cashier in a candy store. Each of your customers buys exactly one item costing $1.00 or less. Each customer pays for the item with exactly $1.00. Your job is to give each customer the correct amount of change in some combination of pennies, nickels, dimes, and quarters. The combination must be the mini- mum number of coins. For example, if the item cost is $.38, the change would be 2 quarters, 1 dime, 0 nickels, and 2 pennies ($.62). The input is composed of customer records, each containing customer name and item cost. The output is composed of lines, each containing customer name, item cost, change, number of quarters, number of dimes, number of nick- els, and number of pennies. A cost of $0.00 will be used to signal the end of the input

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_2

Step: 3

blur-text-image_3

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions