Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. def intro_statement():
  2. print("This program reads exam/homework scores\n"
  3. "and reports your overall course grade.")
  4.  
  5. def midterm1():
  6. print("Midterm 1:")
  7. weight=int(input("Weight (0-100)? "))
  8. score=int(input("Score earned?? "))
  9. if (score>=100):
  10. score=100
  11. shift=int(input("Were scores shifted (1=yes, 2=no)? "))
  12. if (shift==1):
  13. shift_points=int(input(("How many points were shifted? ")))
  14. total=int(score+shift_points)
  15. if (total>=100):
  16. total=100
  17. print("Total points = "+str(total)+" / 100")
  18. if (shift==2):
  19. total=int(score)
  20. if (total>=100):
  21. total=100
  22. print("Total points = "+str(total)+" / 100")
  23. weighted_score=float((total*weight)/100)
  24. print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
  25. print()
  26.  
  27. def midterm2():
  28. print("Midterm 2:")
  29. weight=int(input("Weight (0-100)? "))
  30. score=int(input("Score earned?? "))
  31. if (score>=100):
  32. score=100
  33. shift=int(input("Were scores shifted (1=yes, 2=no)? "))
  34. if (shift==1):
  35. shift_points=int(input(("How many points were shifted? ")))
  36. total=int(score+shift_points)
  37. if (total>=100):
  38. total=100
  39. print("Total points = "+str(total)+" / 100")
  40. if (shift==2):
  41. total=int(score)
  42. if (total>=100):
  43. total=100
  44. print("Total points = "+str(total)+" / 100")
  45. weighted_score=float((total*weight)/100)
  46. print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
  47. print()
  48. def final():
  49. print("Final:")
  50. weight=int(input("Weight (0-100)? "))
  51. score=int(input("Score earned?? "))
  52. if (score>=100):
  53. score=100
  54. shift=int(input("Were scores shifted (1=yes, 2=no)? "))
  55. if (shift==1):
  56. shift_points=int(input(("How many points were shifted? ")))
  57. total=int(score+shift_points)
  58. if (total>=100):
  59. total=100
  60. print("Total points = "+str(total)+" / 100")
  61. if (shift==2):
  62. total=int(score)
  63. if (total>=100):
  64. total=100
  65. print("Total points = "+str(total)+" / 100")
  66. weighted_score=float((total*weight)/100)
  67. print("Weighted score = "+str(round(weighted_score,1))+" / "+str(weight))
  68. print()
  69.  
  70.  
  71.  
  72. def main():
  73. intro_statement()
  74. midterm1()
  75. midterm2()
  76. final()
  77.  
  78. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement