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 .")

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT