Burhan@mail - Uoguelph.ca: Week Two Lab Burhan Malik CIS 1500 Mark

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Week two lab

Burhan Malik [email protected]


CIS 1500
Mark
tim mills ([email protected])
justin luyt ([email protected])
kieran ross-nday ([email protected])
isra Sinan ([email protected])
Problem: Design a program to calculate the score required on a final exam given the
current average (as a percent) of the student and the weight of the final exam (as a
percent). The program should allow the user to select a minimum and maximum for the
desired final grade and should provide the user with a chart of predicted final grades
and final exam grades within that minimum/maximum range.
Solution:
Output needed:
score required to achieve certain value(as a percent) on a final exam. (represented by
variable fg)
Constants:
Weight of the exam (let weight be represented by variable w)
Current average (let current average be represented by variable a)
Weight of current mark (let weight of current mark be represented by l)
Input:
desired grade (includes maximum or minimum and all values in between, desired grade
represented by variable dg)
Variables:
Weight of the exam (let weight be represented by variable w)
Current average (let current average be represented by variable a)
Weight of current mark (let weight of current mark be represented by l)
desired grade (includes maximum or minimum and all values in between, desired
grade represented by variable dg)
Solution : ((l / 100) * a) + (fg * (w / 100)) = dg
When calculating for the maximum grade possible fg=100,
When calculating for the minimum grade possible fg=0
When solving for both maximum or minimum grade possible fg = 82(max), or 42(min)

Formula in action (assuming l = 60%, a = 70, w=40%, dg=80)


((l / 100) * a) + (fg * (w / 100)) = dg
((60 / 100) * 70) + (fg * (40 / 100)) = 80
(.6 x 70) + (.4fg) = 80
80 -42 = .4fg
38/.4 = fg
95 = fg.
THEREFORE in order to achieve a desired grade of 80 in the course, with the exam being
weighted at 40%, the student must score a percent of 95 on the final.
From here the program can input values of fg into a chart depending on what the desired grade
is.

You might also like