;; ;;******************************************* ;; ;;Assignment 01, Question 4 ;;(Course grade manipulation) ;; ;;******************************************* ;; (define weight-participation 0.05) (define weight-assignments 0.2) (define weight-midterm1 0.1) (define weight-midterm2 0.2) (define weight-exam 0.45) ;; final-CS135-grade: num num num num num -> num ;; Calculates your final course grade acccording to weightings. ;; Example: ;; (final-CS135-grade 100 100 100 100 100) => 100 (define (final-CS135-grade participation assignments midterm1 midterm2 exam) (+ (* participation weight-participation) (* assignments weight-assignments) (* midterm1 weight-midterm1) (* midterm2 weight-midterm2) (* exam weight-exam))) ;; final-exam-grade-needed-CS135: num num num num num -> num ;; Returns the mark needed on the final exam to acheive the desired final mark for the course ;; Example: ;; (final-CS135-grade 50 50 50 50 70) => 94.4 (define (final-exam-grade-needed-CS135 participation assignments midterm1 midterm2 desiredfinal) (/ (- desiredfinal (* participation weight-participation) (* assignments weight-assignments) (* midterm1 weight-midterm1) (* midterm2 weight-midterm2)) weight-exam))