Question: (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

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!