; Scheme code used to calculate grades for Clinger's section of ; COM 1204, spring 2002. (define (curve-midterm x) (+ x 1)) (define (curve-final x) (+ x 6)) (define (raw-homework-average x) (let* ((hw (map num (list (hw1 x) (hw2 x) (hw3 x) (hw4 x) (hw5 x) (hw6 x))))) (/ (* 10.0 (apply + hw)) (length hw)))) (define (rawscore x) (let* ((hwavg (raw-homework-average x)) ; The homework average will be adjusted upward if the student ; did better on the final exam's 4 programming problems than ; on the homework (hwavg (max hwavg (+ (* .25 hwavg) (* .75 (final-pgms x))))) ; the weighted average of the curved test scores (testavg (+ (* .4 (curve-midterm (midterm x))) (* .6 (curve-final (final x))))) ; the test-adjusted homework and test scores are weighted equally ; (which in reality gives more weight to the final exam, since it ; was used to adjust the homework average) (avg (round1 (/ (+ hwavg testavg) 2.0)))) ; certain special circumstances call for a special adjustment (if (special? x) (special-curve avg) avg)))