Write 5 functions to assist you to determine your final course grade in this cla
ID: 3692092 • Letter: W
Question
Write 5 functions to assist you to determine your final course grade in this class. The five functions are:
myDaily – should accept 3 arrays as inputs: Homework grades (out of 100), CFU grades (out of 100), and In-class/RAT grades (out of 100) and return a scaled average from 0-100. The average is weighted 50% homework, 40% CFU, 10% Daily/RAT.
myExam – should accept two inputs: Exam1 score and Exam 2 score. It should return the average of these grades on a scale of 0-100. The average is weighted as 10% on the lowest score and 20% on the highest score.
myProj – should accept subtask1, subtask2, designnotebook, Demo, presentation, and report as inputs and return the average on a scale of 0-100. The percentages are given as follows: subtask1=8.333% subtask2, designnotebook, report and presentation = 16.6667% and Demo=25%.
myVideo – should accept 4 Boolean values: 1 for each of the three departmental videos and one for the industry seminar. It should return a scaled value in the range of 0-100. They are equally distributed, so each “True” is worth 25 points.
myGrade – should accept 4 inputs: Daily Average, Exam Average, Project Average, and Video Average and return 2 parameters, a scaled numeric grade in the range of 0-100 and a Letter Grade based on the 89.5/79.5/69.5/59.5 cutoff scale. The weights are given as: myDaily: 34%, myExam: 30%, myProj: 30%, myVideo: 6%
Explanation / Answer
def myDaily(home_work,CFU,RAT):
sum_1 = 0;
for marks in home_work:
sum_1 += sum_1
sum_2 = 0;
for marks in CFU:
sum_2 += marks
sum_3 = 0
for marks in RAT:
sum_3 += marks
return (0.5*sum_1 + 0.4*sum_2 + 0.1*sum_3)
def myExam(exam_1,exam_2):
sum_1 = min(exam_1,exam_2)*0.1
sum_2 = max(exam_1,exam_2)*0.2
return (sum_1 + sum_2)*(10.0/3.0)
def myProj(subtask1,subtask2,designnotebook,demo,presentation,report):
return 0.08333*subtask1 + 0.16667*(subtask2+designnotebook+presentation+report) + 0.25*demo
def myVideo(a,b,c,d):
sum_1 = 0
if (a == True):
sum_1 += 25
if (b == True):
sum_1 += 25
if (c == True):
sum_1 += 25
if (d == True):
sum_1 += 25
return sum_1
def myGrade(d_avg,e_avg,p_avg,v_avg):
l = []
marks = 0.34*d_avg + 0.3*e_avg + 0.34*p_avg + 0.06*v_avg
l.append(marks)
if (marks >= 89.5):
l.append('A')
elif (marks >= 79.5):
l.append('B')
elif (marks >= 69.5):
l.append('C')
elif (marks >= 59.5):
l.append('D')
else:
l.append('F')
return l
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.