HtDP-Sep-2003-Exercise-2.3.2
From Boozled
Contents |
Exercise 2.3.2 from HtDP
The local supermarket needs a program that can compute the value of a bag of coins. Define the program sum-coins. It consumes four numbers: the number of pennies, nickels, dimes, and quarters in the bag; it produces the amount of money in the bag.
Attempt
Scheme
;; If; penny == 1; nickel == 5; dime == 10; quarter == 25;; There is no error handling. I assume sane input ie no negative values etc.;