Question: Hi, this code has been showing me error and i dont know what is wrong with it please if i can get an extra look

Hi, this code has been showing me error and i dont know what is wrong with it please if i can get an extra look from someone else to fix the proble i will appreciate it. thanks.

/**

* Dispenses the remaining value in terms of a given coin value.

* Leaving the remaining balance as the new remaining value, and

* returning the amount of coins of the particular given value that

* can be dispensed.

*

* @param coinValue, value of the coin to be dispensed

* @return amount of the given coin value that can be dispensed

*/

private int dispenseCoin(int coinValue)

{

int count = 0;

// check if the remaining value can disburse at least one coin,

// if not do not perform any calculations

if (_remainingValue > coinValue)

{

count = _remainingValue / coinValue;

_remainingValue %= coinValue;

}

return count;

}

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!