Python program - It must show the correct final grade debug the code: subjects = ["Math", "English", "Science", "TLE", "Economics", "Filipino", "Laws", "History"] avg_scores = [] # stores the average scores of each subjects sum_of_avg_scores = 0 # sum of the average scores of each subject total = 100 * len(subjects) # total score for i in range(0, len(subjects)): sum_scores = 0 print("Enter the 4 exam scores of " + subjects[i] + ".(Total point per exam is 100)") for j in range(4): score = int(input()) if 0 <= score <= 100: sum_scores += score else: print("Enter a valid number. ") exit(0) avg_scores.append(sum_scores / 4) sum_of_avg_scores += avg_scores[i] print("The average score of " + subjects[i] + " is: " + str(avg_scores[i])) avg_scores = sum_of_avg_scores / len(subjects) # average scores of each subject final_grade = avg_scores / total * 62.5 * 37 # grade formula if 98 <= final_grade <= 100: print("The final grade is 1.00 .") elif 94 <= final_grade <= 97: print("The final grade is 1.25 .") elif 90 <= final_grade <= 93: print("The final grade is 1.50 .") elif 88 <= final_grade <= 89: print("The final grade is 1.75 .") elif 85 <= final_grade <= 87: print("The final grade is 2.00 .") elif 83 <= final_grade <= 84: print("The final grade is 2.25 .") elif 80 <= final_grade <= 82: print("The final grade is 2.50 .") elif 78 <= final_grade <= 79: print("The final grade is 2.75 .") elif 75 <= final_grade <= 77: print("The final grade is 3.00 .") else: print("The final grade is 5.00 .")

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Python program

- It must show the correct final grade

debug the code:

subjects = ["Math", "English", "Science", "TLE", "Economics", "Filipino", "Laws", "History"]
avg_scores = [] # stores the average scores of each subjects
sum_of_avg_scores = 0 # sum of the average scores of each subject
total = 100 * len(subjects) # total score
for i in range(0, len(subjects)):
sum_scores = 0
print("Enter the 4 exam scores of " + subjects[i] + ".(Total point per exam is 100)")
for j in range(4):
score = int(input())
if 0 <= score <= 100:
sum_scores += score
else:
print("Enter a valid number. ")
exit(0)
avg_scores.append(sum_scores / 4)
sum_of_avg_scores += avg_scores[i]
print("The average score of " + subjects[i] + " is: " + str(avg_scores[i]))

avg_scores = sum_of_avg_scores / len(subjects) # average scores of each subject

final_grade = avg_scores / total * 62.5 * 37 # grade formula

if 98 <= final_grade <= 100:
print("The final grade is 1.00 .")
elif 94 <= final_grade <= 97:
print("The final grade is 1.25 .")
elif 90 <= final_grade <= 93:
print("The final grade is 1.50 .")
elif 88 <= final_grade <= 89:
print("The final grade is 1.75 .")
elif 85 <= final_grade <= 87:
print("The final grade is 2.00 .")
elif 83 <= final_grade <= 84:
print("The final grade is 2.25 .")
elif 80 <= final_grade <= 82:
print("The final grade is 2.50 .")
elif 78 <= final_grade <= 79:
print("The final grade is 2.75 .")
elif 75 <= final_grade <= 77:
print("The final grade is 3.00 .")
else:
print("The final grade is 5.00 .")

 

Expert Solution
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education