Answer:
# Prompt the user to enter the score for first quiz
quiz1 = int(input("Enter your score for first quiz: "))
# Prompt the user to enter the score for second quiz
quiz2 = int(input("Enter your score for second quiz: "))
# Prompt the user to enter the score for midterm exam
midterm_exam = int(input("Enter your score for the mid term exam: "))
# Prompt the user to enter the score for final exam
final_exam = int(input("Enter your score for the final exam: "))
# sum of first and second quiz is assigned to total_quiz
total_quiz = quiz1 + quiz2
# the two quiz are normalized as 25%
normalized_quiz = (total_quiz / 20) * 25
# the midterm_exam is normalized as 25%
normalized_midterm_exam = (midterm_exam / 100) * 25
# the final_exam is normalized as 50%
normalized_final_exam = (final_exam / 100) * 50
# the total score is calculated by summing all normalized score
total_grade = normalized_quiz + normalized_midterm_exam + normalized_final_exam
# if-else block that compare the total grade
# and output the corresponding letter
# It output A if total_grade >= 90 and <= 100
# It output B if total_grade < 90 and >= 80
# It output C if total_grade < 80 and >= 70
# It output D if total_grade < 70 and >= 60
# It output F if total_grade < 60
if(total_grade >= 90 and total_grade <= 100):
print("Your score is: ", total_grade, " and your grade is A.")
elif(total_grade < 90 and total_grade >= 80):
print("Your score is: ", total_grade, " and your grade is B.")
elif(total_grade < 80 and total_grade >= 70):
print("Your score is: ", total_grade, " and your grade is C.")
elif(total_grade < 70 and total_grade >= 60):
print("Your score is: ", total_grade, " and your grade is D.")
elif(total_grade < 60):
print("Your score is: ", total_grade, " and your grade is F.")
Step-by-step explanation:
The program is written in Python and well-commented. A sample image of program output is attached.