Assignment #2


Now we want you to do a slightly larger program that involves a bit of data abstraction and having you play with lists a bit more. For this assignment, I want you to set up the functions to deal with a student that has grades like you would for this class. Your student type should keep track of the student's name and grades. That includes the 4 types of grades that you get in the class. The following is a list of functions that I want you to write to deal with this data type (DT).

(create-student name) - returns your student DT with the given name and no grades, but probably has places held for them.

(add-assignment student grade) - returns a new student based on the old one, but with the new assignment grade added.

(add-quiz student grade) - returns a new student based on the old one, but with the new quiz grade added.

(add-test student grade) - returns a new student based on the old one, but with the new test grade added.

(set-cp student grade) - returns a new student based on the old one, but with the new value for class participation.

(calc-assignment-average student) - returns the assignment average for this student.

(calc-quiz-average student) - returns the quiz average for this student. Remember to drop the lowest.

(calc-test-average student) - returns the test average for this student.

(get-assignment-average student) - returns the class participation grade for this student.

(calc-final-average) - returns the full average for the student.

Think about what other functions you could write that would help you to implement these. Also think about how you will store the student DT. I would recommend you not do a flat list, but think about a list of lists.

Extra Credit: Add in functions that allow for removing grades of different types by index or replacing grades of different types by index.