total-profit. It consumes the number of attendees (of a
show) and produces how much income the attendees produce.
tax, which consumes the gross pay
and produces the amount of tax owed. For a gross pay of $240 or
less, the tax is 0%; for over $240 and $480 or less, the tax rate is
15%; and for any pay over $480, the tax rate is 28%.
discount, which takes the name of an
organization that someone belongs to and produces the discount (a
percentage) that the person should receive on a purchase. Members
of AAA get %10, members of ACM or IEEE get %15, and members of UPE
get %20. All other organizations get no discount.
Use discount to write purchase, which takes the
price of an item and the name of an organization and produces the
amount owed after the discount is applied.
assign-grade that takes a grade record
and produces a grade record. The produced grade record has the same
exam grades as the original, but has computed the course grade from
the exam grades. The course grade is A for an average above 85, B
for an average between 70 and 84, C for an average between 55 and
69, and NR otherwise.
new-student which consumes a student
name and class year and produces a student record with the given
name and class year, both exam grades initialized to 0 and the
course grade initialized to false.
finished? which consumes a student and
produces a boolean indicating whether the student has enough courses
to graduate. Undergraduates need 45 courses, graduates need 11 for
an MS and 60 for a PhD. Non-degree students are always finished.
eliminate-large that consumes a list
of numbers and produces a lis of all numbers from the original list
that are larger than 10.
elim-by-pred that consumes a
predicate (function that returns boolean) on numbers and a list
of numbers and produces the list of all numbers for which the given
function returns false.
average that consumes a list of
numbers and produces its average. Return an error message if the list
is empty.
suffixes that consumes a list L
(containing anything) and produces a list of all the suffixes of L.
For example, (suffixes '(a b c d)) should produce
((a b c d) (b c d) (c d) (d) ()).
unknown or a person, where a person
has a name (string), eye color (symbol), mother (family tree) and
father (family tree).
count-persons that consumes a
family tree and produces the total number of people in that
tree.
count-gens that consumes a
family tree and produces the number of generations in that
tree.
eye-colors that consumes a family
tree and produces a list of all eye colors that appear in the tree.
The list may contain duplicates.
Hint: use append which consumes any number of lists
and concatenates them.