Question: I need a coin removal function written in java that can take a price and a bank with values for quarters, dimes, nickels, and pennies

I need a coin removal function written in java that can take a price and a bank with values for quarters, dimes, nickels, and pennies and determine what coins are available to pay for an item and deduct them from the balance.

function declared like

public void removeCoins(Bank currentBank, float price)

price is price of object that is being paid for via bank in format of float ie $2.50 would be 2.5f

currentBank has currentBank.quarters, currentBank.dimes, currentBank.nickels, currentBank.pennies. This is a literal count of the number of quarters, dimes, etc..

Feel free to make supporting functions if necessary.

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!