;;;;; ;;;;; Grade calculator for CS3 ;;;;; ;; re-written in Summer 08, no guarantees for accuracy in future rubrics! ;; fill in the score lists in the data section, ;; then call (grade-report) ;;; ;;; data ;;; ;; each category of score has its own list; enter your scores. ; e.g., (define *hwk-scores* '(15 3 3 1 10 2)) ; you don't need to include any 0s ;; homework scores (define *hwk-scores* '( )) ;; quiz scores (define *quiz-scores* '( )) ;; midterms - use the scaled score ;; (the first one should be out of 24 and the second one out of 36 ) (define *midterm-scores* '( )) ;; miniproject - each out of 20 (define *miniproject-scores* '( )) ;; These categories have contain a single number as data ; e.g. (define *final-score* 33) ;; total number of quizzes (define *total-quiz-count* ) ;; final exam score - out of 40 (define *final-score* ) ;; final project score - out of 30 (define *project-score* ) ;; participation - out of 6 (define *partic-score* ) ;;; ;;; other stuff ;;; ; maximum scores before scaling (define *max-raw-miniproject-possible* 60) (define *max-raw-hwk-possible* 148) (define *max-raw-quiz-possible* (* 10 *total-quiz-count* )) (define *max-raw-partic-possible* 30) ; maximum scores in terms of 'course points' (define *max-hwk-possible* 24) (define *max-quiz-possible* 16) (define *max-miniproject-possible* 24) (define *max-midterms-possible* 60) (define *max-project-possible* 30) (define *max-partic-possible* 6) (define *max-final-possible* 40) ; these factors determine what the cap is for hwk and quizzes. If a factor is ; .6, that means the cap is at 60% of the maximum possible grade. (define *hwk-capping-factor* 1) (define *quiz-capping-factor* .6) (define (grade-report) (let ((hwk-raw (cap-score (apply + *hwk-scores*) *hwk-capping-factor* *max-raw-hwk-possible* "homework")) (quiz-raw (cap-score (apply + *quiz-scores*) *quiz-capping-factor* *max-raw-quiz-possible* "quizzes"))) (let ((hwk-scale (scale hwk-raw (* *hwk-capping-factor* *max-raw-hwk-possible*) *max-hwk-possible*)) (quiz-scale (scale quiz-raw (* *quiz-capping-factor* *max-raw-quiz-possible*) *max-quiz-possible*)) (mp-scale (scale (apply + *miniproject-scores*) *max-raw-miniproject-possible* *max-miniproject-possible*)) (midterm (score (apply + *midterm-scores*) *max-midterms-possible* "midterms")) (project (score *project-score* *max-project-possible* "project")) (final (score *final-score* *max-final-possible* "final")) (partic (score *partic-score* *max-partic-possible* "participation")) ) (let ((course-points (+ hwk-scale quiz-scale mp-scale midterm project final partic)) ) (display "Hwk (total: ") (display (align (apply + *hwk-scores*) 6 2)) (display ") (capped: ") (display (align hwk-raw 6 2)) (display ") : ") (display (align hwk-scale 6 2)) (display " out of 24 ") (show "") (display "Quiz (total: ") (display (align (apply + *quiz-scores*) 6 2)) (display ") (capped: ") (display (align quiz-raw 6 2)) (display ") : ") (display (align quiz-scale 6 2)) (display " out of 16 ") (show "") (display "MiniProject (total: ") (display (apply + *miniproject-scores*)) (display ") : ") (display mp-scale) (display " out of 24 ") (show "") (display "Midterm: ") (display midterm) (display " out of 60 ") (show "") (display "Project: ") (display project) (display " out of 30 ") (show "") (display "Final: ") (display final) (display " out of 40 ") (show "") (display "Participation: ") (display partic) (display " out of 6 ") (show "") (show "----") (display "Course Points: ") (show (align course-points 6 2)) ;; for those of you taking the course P/NP, you will P if your ;; letter grade is above an F... (display "Letter Grade: ") (show (letter-grade course-points)) )))) (define (scale raw-amount raw-max scale-max) (* (/ raw-amount raw-max) scale-max)) ; a check for obvious errors (define (score amount max area) (if (> amount max) (begin (display "Problem with your data entry: ") ;;begin (show area) max) amount)) (define (cap-score amount capping-factor max area) (let ((cap-max (* capping-factor max))) (cond ((> amount max) (display "Problem with your data entry: ") (show area) cap-max) ((> amount cap-max) cap-max) (else amount)))) (define (letter-grade cp) (cond ((>= cp 185) "A+") ((>= cp 165) "A") ((>= cp 155) "A-") ((>= cp 145) "B+") ((>= cp 135) "B") ((>= cp 125) "B-") ((>= cp 115) "C+") ((>= cp 105) "C") ((>= cp 95) "C-") ((>= cp 75) "D") (else "F")))