grades.rkt (CS 135 Assignment 1)

The instructions for this code is located here.

#lang racket

; returns the weighted average of the midterm grades and the final exam grade
; to produce the weighted exam average
(define (cs135-exam-grade midterm-1-grade midterm-2-grade final-exam-grade)
  (/ (+ (* midterm-1-grade 0.10) (* midterm-2-grade 0.20) (* final-exam-grade 0.45)) 0.75))

; returns the final grade in the course, given the three parameters to produce it
(define (cs135-final-grade class-participation-grade weighted-assignment-grade weight-exam-grade)
  (+ (* class-participation-grade 0.05) (* weighted-assignment-grade 0.20) (* weight-exam-grade 0.75)))

; returns the minimum final exam mark required to obtain a 50% weighted exam average
(define (final-cs135-exam-grade-needed midterm-1-grade midterm-2-grade)
  ; exam = (final * 0.45 + mid1 * 0.1 + mid2 * 0.2) / 0.75
  ; final = (exam * 0.75 - mid1 * 0.1 - mid2 * 0.2) / 0.45
  ; where exam is 50%
  (define weight-exam-mark 50)
  (/ (- (* weight-exam-mark 0.75) (* midterm-1-grade 0.10) (* midterm-2-grade 0.20)) 0.45))
DOWNLOAD

            Created: October 3, 2014
Completed in full by: Michael Yaworski