Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions