Math problem

Here is my problem:
"Write a grading program for a class with the following grading policies.
a. There are two quizzes, each graded on the basis of 10 points.
b. There is one midterm exam and one final exam, each graded on the basis of 100 points.
c. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two
quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They should be converted to a percentage before they are averaged in.)
Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any
grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F."

I have a math problem. How I'm supposed to calculate the grade?

Last edited on
> How I'm supposed to calculate the grade?

Answer

Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F.


It's something a bunch of if...else statements would solve, start something!
It's something a bunch of if...else statements would solve, start something!


Yes. But that's the easy part. I can't figure out how to get the grade as number.
Need something like this ?
 
finalGrade = finalExamGrade * 0.5 + midtermExamGrade * 0.25 + (firstQuizGrade + secondQuizGrade) * 1.25 ; 

Need something like this ?

Yep...
But 0.5+0.25+1.25=2.
They mean 0.125 i.e 12.5% not 125%

So 100*0.5+100*.25+(100+100)*0.125=1
Last edited on
But You have said that the grading base of the quizzes is 10 so :

100 * 0.5 + 100 * 0.25 + (10 + 10 ) * 1.25 = 100
They mean 0.125 i.e 12.5% not 125%

I'm a bit confused. I don't see 12.5% anywhere.
100 * 0.5 + 100 * 0.25 + (10 + 10 ) * 1.25 = 100

Still don't get it. Why 1.25?
First, normalize the grades to a number between 0.0 and 1.0. So divide quiz scores by 10 and midterm/final grades by 100.

Now compute the weighted average as described:
finalExam*0.5 + midTerm*0.25 + (quiz1+quiz2) * 0.25.

This produces a normalized grade between 0.0 and 1.0. Next convert this to a letter grade as described.
finalExam*0.5 + midTerm*0.25 + (quiz1+quiz2) * 0.25.

So, the best possible grade would be:
0.5+0.25+0.5=1.25.
So, the best possible grade would be:
0.5+0.25+0.5=1.25.

My bad. The quizes count for a total of 25%, so 12.5% each:
finalExam*0.5 + midTerm*0.25 + (quiz1+quiz2) * 0.125
finalExam*0.5 + midTerm*0.25 + (quiz1+quiz2) * 0.125

I'm not really sure if I understand how, but this seems to work.
Thank you.
Topic archived. No new replies allowed.