Question: In the following function, current _ score is the student's overrall score IF they skip the final exam ( this variable counts a 0 on

In the following function, current_score is the student's overrall score IF they skip the final exam (this variable counts a 0on the final exam). Final_weight represents the weight of the overall course grade that the final exam holds. Target score is the overall grade that the student is aiming for in the course. And required score is meant to return the required final exam score for a student to reach the desired overrall grade in the course. Please help fix the function so that I can return the correct required score: def required_final_exam_score(current_score, final_weight, target_score):
# Calculate the proportion of the final exam weight
final_weight_ratio = final_weight /100
# Calculate the proportion of the current score weight
current_score_weight =1- final_weight_ratio
# Calculate the required score on the final exam
required_score =(target_score - current_score * current_score_weight)/ final_weight_ratio
return required_score
# Get user input
current_score = float(input("Enter the current overall score if you skipped the final exam (got a 0 on the final): "))
final_weight = float(input("Enter the final exam weight (in percentage): "))
target_score = float(input("Enter the target overall course grade: "))
# Calculate the required final exam score
required_score = required_final_exam_score(current_score, final_weight, target_score)
# Display the required score
print("Required Final Exam Score:", required_score)
SAMPLE Test case
--------------
Enter the current score: 72.5
Enter the final exam weight (in percentage): 20
Enter the target overall course grade: 90
Required Final Exam Score: 160.0
Process finished with exit code 0
# The required exam score4 is obviously incorrect, please help me fix the function and run this test case to verify the fixed function works please.

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!