CS 2135 (A01) Homework 2: Lists

Due: September 13 (Thursday) at 11:59pm via turnin (assignment name hwk2).

Assignment Goals


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 the following grades for each student: hwk1, hwk2, hwk3, midterm, final, and course (the final course grade). The student info you received from the registrar consists of a first name, last name, class year, and id number for each student.

  1. Develop a data model and data definitions for your gradebook. 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 advisor). Design your model with such future changes in mind.

  2. Write the template for programs over gradebooks.

  3. Write a program add-student that takes a gradebook and the new student's first name, last name, class year, and id number and returns a gradebook containing the new student and all of the students in the original gradebook. The new student should have 0s on all assignments and exams and the final course grade.

  4. Write a program remove-student that takes a gradebook and a student's last name and id number and returns a gradebook containing all students except the one with the given name and id.

  5. Write a program compute-course-grades that takes a gradebook and returns a gradebook with course grades calculated for each student. The course grades are computed according to the formula of homeworks being worth 10\% each and exams being worth 35\% each.

  6. Write a program sort-by-dec-grades that takes a gradebook and returns a gradebook sorted in decreasing order by students' course grades.

    Write your own sorting function for this problem. Do not use one of the sorting functions built-in to DrScheme.

  7. Write a program sort-by-inc-midterm that takes a gradebook and returns a list of midterm scores sorted in increasing order.

    This program should use the same sorting function as the previous problem.

  8. Write a program final-average that consumes a gradebook and returns the average grade on the final exam.

  9. The registrar requires faculty to submit grade reports showing the final grades for students. A grade-report contains a student's last name and id number, the course number (make one up), and the final grade (A, B, C, F). Write a program to produce a list of grade-reports from a gradebook (the conversion from numeric course grades to letters is as follows: A=87-100; B=73-86; C=60-72; F=below 60).


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.


Hints and Guidelines


Back to the Assignments page