summaryrefslogtreecommitdiff
path: root/wk1/pset1/cash/cash.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-04 04:01:31 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-04 04:01:31 +0000
commit4ecca707ed8d938397eb3d84a7f3408e240809c7 (patch)
treed738000e0432a2350f29558efec5c2178020e2bb /wk1/pset1/cash/cash.c
parent7163a5c998a611bd4d0397da6d605cdf7fdceaa7 (diff)
Sun, Dec 3, 2023, 8:01 PM -08:00
Diffstat (limited to 'wk1/pset1/cash/cash.c')
-rw-r--r--wk1/pset1/cash/cash.c14
1 files changed, 7 insertions, 7 deletions
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;
}