Question: Given the following function header and docstring, complete the function s body. You may use Python s built - in functions in your solution. def

Given the following function header and docstring, complete the functions body. You
may use Pythons built-in functions in your solution.
def final_grade(final: float, midterm: float, bonus: float)-> float:
"""Return the grade in a course, given the scores in the final and
midterm exams and a bonus score.
The final exam is worth 80%, the midterm 20%, and the bonus is worth 10%.
If the weighted average of the final exam and the midterm exam is below
60 out of 100, the final grade is the weighted average. Otherwise, the
weighted bonus is added, giving a maximum score of 110. The final grade
is the minimum of 100 and the score calculated using the bonus.
Preconditions: all parameter values are between 0 and 100.
>>> final_grade(40.0,0,100)
32.0
>>> final_grade(100,40.0,100)
98.0
>>> final_grade(100,100,100)
100
"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!