Answered step by step
Verified Expert Solution
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, currentscore is the student's overrall score IF they skip the final exam this variable counts a on the final exam Finalweight 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 requiredfinalexamscorecurrentscore, finalweight, targetscore:
# Calculate the proportion of the final exam weight
finalweightratio finalweight
# Calculate the proportion of the current score weight
currentscoreweight finalweightratio
# Calculate the required score on the final exam
requiredscore targetscore currentscore currentscoreweight finalweightratio
return requiredscore
# Get user input
currentscore floatinputEnter the current overall score if you skipped the final exam got a on the final:
finalweight floatinputEnter the final exam weight in percentage:
targetscore floatinputEnter the target overall course grade:
# Calculate the required final exam score
requiredscore requiredfinalexamscorecurrentscore, finalweight, targetscore
# Display the required score
printRequired Final Exam Score:", requiredscore
SAMPLE Test case
Enter the current score:
Enter the final exam weight in percentage:
Enter the target overall course grade:
Required Final Exam Score:
Process finished with exit code
# The required exam score 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started