Question: 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  write in medium-level psuedocode 18. Design an algorithm for the following
problem: You are a cashier in a candy store. Each of your

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

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!