I've just finished cash and it seems to be working as expected when I run a manual test. When I run Check50 though I get the following message:
:( calculate_nickels returns 5 when input is 28 expected "5", not "0"
Not sure what to do as when I input 28 I get 4 back. Any advice much appreciated :) Here is my code + screenshot
int get_cents(void)
{ int change; do { change = get_int("Change due: "); } while (change < 0); return change; }
int calculate_quarters(int cents) { int quarters = cents / 25; return quarters; }
int calculate_dimes(int cents) { int dimes = (cents % 25) / 10; return dimes; }
int calculate_nickels(int cents) { int nickels = ((cents % 25) % 10) / 5; return nickels; }
int calculate_pennies(int cents) { int pennies = ((cents % 25) % 10) % 5; return pennies; }