From 4ecca707ed8d938397eb3d84a7f3408e240809c7 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 4 Dec 2023 04:01:31 +0000 Subject: Sun, Dec 3, 2023, 8:01 PM -08:00 --- wk1/pset1/cash/cash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'wk1/pset1/cash/cash.c') diff --git a/wk1/pset1/cash/cash.c b/wk1/pset1/cash/cash.c index 3f561b5..eda145e 100644 --- a/wk1/pset1/cash/cash.c +++ b/wk1/pset1/cash/cash.c @@ -37,9 +37,10 @@ int main(void) int get_cents(void) { + int i; do { - int i = get_int("How many cents? "); + i = get_int("How many cents? "); } while(i <= 0); return i; @@ -53,18 +54,17 @@ int calculate_quarters(int cents) int calculate_dimes(int cents) { - // TODO - return 0; + cents = cents / 10; + return cents; } int calculate_nickels(int cents) { - // TODO - return 0; + cents = cents / 5; + return cents; } int calculate_pennies(int cents) { - // TODO - return 0; + return cents; } -- cgit v1.2.3