CS 2135 (C03) Homework 2: Lists

Due: January 23 (Thursday) at 11:59pm via turnin (assignment name hwk2).

Assignment Goals

To make sure you can

The Assignment

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.

  1. 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.

  2. Write the template for programs over gradebooks.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. Show how to compute-course-grades to compute final grades according to two formulas:


What to Turn In

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.


Guidelines


Back to the Assignments page