Question: in LISP construct a function WEIGHT-OF-PURCHASE that computes the sum of the weights from a shopping list. The shopping list has two sublists with the
in LISP construct a function WEIGHT-OF-PURCHASE that computes the sum of the weights from a "shopping list". The shopping list has two sublists with the weight of the item as the second element. Please provide the code and output.
Examples: (WEIGHT-OF-PURCHASE '((MILK 1000 GRAMS) (SUGAR 500 GRAMS))) (WEIGHT-OF-PURCHASE '((FLOUR 500 GRAMS) (CHEESE 100 GRAMS)))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
