Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Java program to simulate a coins to cash exchange machine as follows. Be

ID: 3565246 • Letter: W

Question

Write a Java program to simulate a coins to cash exchange machine as follows.

Begin a balance for the user of zero dollars and cents. Continually prompt the user to deposit coinsaccording to the following stipulations   

Allow unlimited deposits without asking beforehand how many there will be. Let the user quit using an appropriate non numeric sentinel value("cashout")

Allow the user to enter deposits in any of the following formats at will. The entered deposits should be added to the balance in dollars and cents. Allow only positive deposits.

An integer followed by a space and the word quarter, nickel, dime, or penny.

For example, 4 quarter,7 dime, 1 nickel would each be a valid input

Allow combined deposits within a single input

. For example, 3 dime 5 penny 1 dime would be a valid input.

Reject any individual part of the input that is not valid by reporting an error and continuing to process the remaining input.

Maintain the total balance without allowing any precision errors

.This means do not use any floating point primitives

Display the total balance at the beginning and after each deposit.

When the user is finished with deposits display the following results calculated as necessary

Display the total balance of the accumulated coins in dollars and cents.

Calculate and display a 9.1% exchange fee on the balance, rounded up if necessary.

Calculate and display the voucher value of the balance by withholding the exchange fee from it.

Denominate the voucher value into bills and coins and display the results as follows.

Use the simplest combination of twenty, ten, five, and one dollar bills and quarters, dimes, nickels, and pennies to

Explanation / Answer

t

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote