Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def intro_statement():
- print("This program reads exam/homework scores\n"
- "and reports your overall course grade.")
- def midterm1():
- print("Midterm 1:")
- weight=int(input("Weight (0-100)? "))
- score=int(input("Score earned?? "))
- if (score>=100):
- score=100
- shift=int(input("Were scores shifted (1=yes, 2=no)? "))
- if (shift==1):
- shift_points=int(input(("How many points were shifted? ")))
- total=int(score+shift_points)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- if (shift==2):
- total=int(score)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- weighted_score=float((total*weight)/100)
- print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
- print()
- def midterm2():
- print("Midterm 2:")
- weight=int(input("Weight (0-100)? "))
- score=int(input("Score earned?? "))
- if (score>=100):
- score=100
- shift=int(input("Were scores shifted (1=yes, 2=no)? "))
- if (shift==1):
- shift_points=int(input(("How many points were shifted? ")))
- total=int(score+shift_points)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- if (shift==2):
- total=int(score)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- weighted_score=float((total*weight)/100)
- print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
- print()
- def final():
- print("Final:")
- weight=int(input("Weight (0-100)? "))
- score=int(input("Score earned?? "))
- if (score>=100):
- score=100
- shift=int(input("Were scores shifted (1=yes, 2=no)? "))
- if (shift==1):
- shift_points=int(input(("How many points were shifted? ")))
- total=int(score+shift_points)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- if (shift==2):
- total=int(score)
- if (total>=100):
- total=100
- print("Total points = "+str(total)+" / 100")
- weighted_score=float((total*weight)/100)
- print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
- print()
- def main():
- intro_statement()
- midterm1()
- midterm2()
- final()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement