A course syllabus states that there are three grading elements: hw, mid, and final. The weights of these elements in the final grade are: hw 25%, mid 25%, and final 50%. So the formula to calculate one’s final grade is: Score of hw (out of 100) x 0.25+ Score of mid (out of 100) x 0.25+ Score of final (out of 100) x 0.50. Your scored 90/100 in hw, 95/100 in mid, and 87/100 in final. Please write a Python program to compute your final grade.
Requirements:
Python code:
#initializing hw as 90
hw=90
#initializing mid as 90
mid=95
#initializing final as 90
final=87
#finding finalgrade
finalgrade=hw*0.25+mid*0.25+final*0.5
#printing the finalgrade
print("finalgrade =",finalgrade)
Screenshot:
Output:
Get Answers For Free
Most questions answered within 1 hours.