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
Get step-by-step solutions from verified subject matter experts
