Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C# Programming) You are on a team writing code to run a self-service checkout for grocery stores. Your module accepts the amount of change for

(C# Programming)

You are on a team writing code to run a self-service checkout for grocery stores. Your module accepts the amount of change for the customer and determines how to issue that amount in currency. The machine accepts all legal currency denominations up to one hundred dollar bills and returns twenty, ten, five, and one dollar bills, quarter, dime, nickel, and penny coins. Write a program that accepts an amount of money and outputs the number of bills and coins in each denomination to equal that amount.

I give a similar problem in my C++ course that uses a function called compute_coins. The compute_coins function takes three arguments, the value of the coin, the number of coins, and the amount of cash being changed. For example the value of one dollar would be 100. If the amount of cash being changed was 431 (or $4.31) the function would set the number of coins to 4 (4 x 100 = 400) and set the amount of cash to the remainder, 31 cents. The program could call this function once for each denomination being dispensed.

The program should continue until the user chooses to end it (by entering 0 as the dollar amount needed, for example).

Example:

Enter the dollar amount needed: $14.31

To give change in the amount $14.31

Dispense 1 Ten, 4 Ones, 1 Quarter, 1 Nickel, 1 Penny

Enter the dollar amount needed: $1.62

To give change in the amount $1.62

Dispense 1 One, 2 Quarters, 1 Dime, 2 Pennies

Grading Criteria: Exe file (compiled version) submitted. 2 Source files submitted. 2 Program compiles as submitted. 2 Program has no logic errors. 4 Program accepts, validates, and echoes a dollar amount of change needed. 4 Program determines the correct number of bills and coins to dispense. 4 Program properly dispenses Twenty, Ten, Five, and One dollar bills. 4 Program properly dispenses Quarter, Dime, Nickel, and Penny coins. 4 Program loops to allow user to enter a new dollar amount of change to dispense. 4 (Bonus) Program keeps track of remaining bills and coins and alerts user if unable to provide change. 3

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

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

internationalization of business?

Answered: 1 week ago