You've been hired as a TA for a course, and want to automate your handling of student grades. The gradebook must store 5 numeric grades for each student (proj1, proj2, proj3, midterm, final) and a final letter course grade. The student info you received from the registrar consists of a first name, last name, advisor's (last) name, and id number for each student.
Develop a data model and data definitions (with examples) for gradebooks. Gradebooks capture information about students' grades plus the information from the registrar for all students in the class. Consider which information belongs in the same structures, and which belongs in different structures (for example, you may wish to later augment your student info to also reflect a student's class year). Design your model with such future changes in mind.
Write the template for programs over gradebooks.
Write a program missing-midterm?
that takes a
gradebook and returns a boolean indicating whether any student in the
gradebook has a score of 0 on the midterm.
Write a program names-with-grade
that takes a
gradebook and a letter grade and returns a list of last names of
students who have the given letter grade as a final grade.
The registrar wishes to compile grade summaries for advisors.
An advisor report contains a student's first and last names, course
number (make one up) and the final course grade. Write a program
advisor-report
that consumes a gradebook and an advisor's
name and produces a list of advisor reports. The output list should
contain exactly one advisor report for each student in the gradebook
with the given advisor.
Course grades can change based on the percentages assigned to each assignment. You want an easy way to experiment with different percentages for the exams; any points not assigned to the exams will be divided equally across the three projects.
Write a program make-grade-function
that takes in the
weights (a percentage) for the midterm and final and returns a
function that takes a single gradebook entry and produces an overall
numeric grade based on the given percentages. For example, if the
arguments to make-grade-function
were 25 (midterm) and 30
(final), then the returned function would compute the final grade with
each project worth 15 percent, the midterm worth 25 percent and the
final worth 30 percent.
Write a program compute-course-grades
that takes a
gradebook, a function for converting gradebook entries to overall
numeric scores, and a function for converting numeric scores to letter
grades and returns a gradebook with course grades calculated for each
student.
Show how to compute-course-grades
to compute final
grades according to two formulas:
both exams worth 25% each and A=87-100; B=71-86; C=55-70; F=below 55.
the midterm worth 25%, the final worth 30%, and A=89-100; B=75-88; C=62-74; F=below 62.
Turn in a single file hwk2.ss (or hwk2.scm) containing all code and documentation for this assignment. Make sure that both students' names are in a comment at the top of the file.
Refer to the Laws of Homework when preparing your solutions.
Use map and filter whenever appropriate in your solutions. Solutions that match the structure of map and filter but don't use them will lose some points.
Follow the templates! We teach them to you because they help you organize your programs. Programs that don't follow the templates will lose points, so follow the templates (programs that use map and filter are obviously excepted from this rule).
Aim for reuse where possible! If a program you write for one part is useful for another part, reuse it.