Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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 Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions