Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for Question 3 : Assignment Grades On Assignment 0 1 , we worked with the course marking scheme. In this question, we'll focus on the

for Question 3: Assignment Grades
On Assignment 01, we worked with the course marking scheme. In this question, we'll focus on the computation of a grade for the assignment portion of a course.
Let's assume that a course has some number of assignments, each marked individually with a number from 0 to 100(inclusive), all recorded in a list of numbers. Let n represent the length of that list (i.e., the number of assignments). The goal is to produce a single "assignment mark", also between 0 and 100, to which all individual assignments contribute an amount weighted by 100n .
In the simplest case, we might imagine dividing each individual grade by n and adding up the results (which happens to be equivalent to taking the average of the numbers in the list). But life isn't that simple, for a couple of reasons:
We drop a student's lowest assignment grade. That is, we calculate the grade based only on the assignments that remain after the lowest number in the list has been removed from consideration. (We always drop a single assignment, even if multiple assignments are tied for the lowest grade.)
It's possible to be "excused" from one or more assignments, for example because of illness. We'll record any excused assignments by placing a symbol 'x in the list of assignment grades, and skip over them when calculating the grade. (Also, we will drop the lowest numeric grade above, after excused assignments have been removed from consideration.)
Write a function assignment-grade that consumes a list whose elements are a mix of numbers between 0 and 100(inclusive) and the symbol 'x. The function should produce a number between 0 and 100, giving the aggregate assignment grade based on the non-excused assignments with the lowest grade dropped. You can assume that the list contains at least two numeric grades, so that the result can be computed without dividing by zero. For ;; Drop the 30, compute grade based on 80,90.5, and 75.5
>(assignment-grade (cons 80(cons 30(cons 90.5(cons 75.5 empty)))))
82
;; Drop one of the 80s, compute grade based on the other 80 and 90
>(assignment-grade (cons 'x (cons 80(cons 'x (cons 90(cons 80(cons 'x empty)))))))
85example:FOR DR. RACKET Fo

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

Are you a good gift giver?

Answered: 1 week ago