Skip to content

Instantly share code, notes, and snippets.

@EthanArmbrust
Created December 20, 2019 04:54
Show Gist options
  • Select an option

  • Save EthanArmbrust/f63b4a77f686c155a4a8778b10e1b5ab to your computer and use it in GitHub Desktop.

Select an option

Save EthanArmbrust/f63b4a77f686c155a4a8778b10e1b5ab to your computer and use it in GitHub Desktop.
CSE 421 Grade Calculator
quizes = []
homeworks = []
for i in range(1, 6):
temp = input("Enter quiz {} score: ".format(i))
quizes.append(temp)
for i in range(1, 5):
temp = input("Enter homework {} score: ".format(i))
homeworks.append(temp)
project_1 = input("Enter Project 1 score: ")
project_2 = input("Enter Project 2 score: ")
exam_1 = input("Enter Midterm 1 score: ")
exam_2 = input("Enter Midterm 2 score: ")
quizes.sort()
quizes = quizes[1:]
final = 0.0
for q in quizes:
final += (float(q) * 0.0125)
for h in homeworks:
final += (float(h) * 0.0125)
final += float(project_1) * (100/110) * 0.2
final += float(project_2) * 0.2
final += float(exam_1) * 0.25
final += float(exam_2) * 0.25
print("Final score: ", final)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment