time due | submission file |
---|---|
9:00 AM Wednesday 25 October, 2006 | csci/431/HW6/gradem.umb |
Assume you have a class where class work is weighted according to the table shown below:
Work | Number | Weight |
---|---|---|
Homework | 8 | 20% |
Quizes | 3 | 40% |
Final | 1 | 40% |
And assume the following final grade assignments:
average | grade |
---|---|
&ge 90 | A |
&ge 80 | B |
&ge 70 | C |
&ge 60 | D |
< 60 | F |
Finally, suppose the record grades for em students are stored in a LISP S-expression using the format shown below.
(
("Working Hard" (95 90 95 80 91 99 95 90) (99 87 89) 95)
("Average Joe" (78 78 78 78 78 78 78 78) (78 78 78) 78)
("Fading Fast" (90 80 70 60 50 40 30 20) (80 40 40) 10)
("Outa Range" (105 80 70 60 50 40 30 20) (80 40 40) 10)
("Miss Scores" (90 80 70 60 50 40 30 20) (80 40) 10)
("Notta Number" (() 80 70 60 50 40 30 20) (80 40 40) 10)
)
Your job is to write a Scheme function gradem
that can be executed with
umb-scheme
, that will transform S-expressions like
that shown above into one like that shown below:
(
("Working Hard" "A")
("Average Joe" "C")
("Fading Fast" "F")
("Outa Range" "?")
("Miss Scores" "?")
("Notta Number" "?")
)