Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.68 KB | None | 0 0
  1. name = raw_input("Please enter your name, so that I know how to address you!" " ")
  2. semester = int(raw_input("Nice to meet you" + " " + name + ", " + "please tell me, how many semesters have you completed?" " "))
  3.  
  4.  
  5. if semester == 1 :
  6. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  7. a = float(num1)/1
  8. if a >= 3.5 :
  9. print "Good job " + name + ", " + "your GPA is great!"
  10. if a > 3 and a <3.5 :
  11. print "Nice, but I am sure you can do better," + " " + name + "."
  12. if a <= 3 and a > 2 :
  13. print name + " " + "don't give up! You should try harder!"
  14. if a <= 2 :
  15. print name + " " + "you better work harder, or you will be on probation!"
  16. print name + "'s" + " overall GPA is" + " " + str(a)
  17.  
  18. elif semester == 2 :
  19. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  20. num2 = float(input("Enter your 2-nd semester GPA: "))
  21. a = float(num1 + num2)/2
  22. if a >= 3.5 :
  23. print "Good job " + name + ", " + "your GPA is great!"
  24. if a > 3 and a <3.5 :
  25. print "Nice, but I am sure you can do better," + " " + name + "."
  26. if a <= 3 and a > 2 :
  27. print name + " " + "don't give up! You should try harder!"
  28. if a <= 2 :
  29. print name + " " + "you better work harder, or you will be on probation!"
  30. print name + "'s" + " overall GPA is" + " " + str(a)
  31.  
  32. elif semester == 3 :
  33. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  34. num2 = float(input("Enter your 2-nd semester GPA: "))
  35. num3 = float(input("Enter your 3-rd semester GPA: "))
  36. a = float(num1 + num2 + num3)/3
  37. if a >= 3.5 :
  38. print ("Good job " + name + ", " + "your GPA is great!")
  39. if a > 3 and a <3.5 :
  40. print ("Nice, but I am sure you can do better," + " " + name + ".")
  41. if a <= 3 and a > 2 :
  42. print (name + " " + "don't give up! You should try harder!")
  43. if a <= 2 :
  44. print (name + " " + "you better work harder, or you will be on probation!")
  45. print(name + "'s" + " overall GPA is" + " " + str(a))
  46.  
  47. elif semester == 4 :
  48. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  49. num2 = float(input("Enter your 2-nd semester GPA: "))
  50. num3 = float(input("Enter your 3-rd semester GPA: "))
  51. num4 = float(input("Enter your 4-th semester GPA: "))
  52. a = float(num1 + num2 + num3 + num4)/4
  53. if a >= 3.5 :
  54. print ("Good job " + name + ", " + "your GPA is great!")
  55. if a > 3 and a <3.5 :
  56. print ("Nice, but I am sure you can do better," + " " + name + ".")
  57. if a <= 3 and a > 2 :
  58. print (name + " " + "don't give up! You should try harder!")
  59. if a <= 2 :
  60. print (name + " " + "you better work harder, or you will be on probation!")
  61. print(name + "'s" + " overall GPA is" + " " + str(a))
  62.  
  63. elif semester == 5 :
  64. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  65. num2 = float(input("Enter your 2-nd semester GPA: "))
  66. num3 = float(input("Enter your 3-rd semester GPA: "))
  67. num4 = float(input("Enter your 4-th semester GPA: "))
  68. num5 = float(input("Enter your 5-th semester GPA: "))
  69. a = float(num1 + num2 + num3 + num4 + num5)/5
  70. if a >= 3.5 :
  71. print ("Good job " + name + ", " + "your GPA is great!")
  72. if a > 3 and a <3.5 :
  73. print ("Nice, but I am sure you can do better," + " " + name + ".")
  74. if a <= 3 and a > 2 :
  75. print (name + " " + "don't give up! You should try harder!")
  76. if a <= 2 :
  77. print (name + " " + "you better work harder, or you will be on probation!")
  78. print(name + "'s" + " overall GPA is" + " " + str(a))
  79.  
  80. elif semester == 6 :
  81. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  82. num2 = float(input("Enter your 2-nd semester GPA: "))
  83. num3 = float(input("Enter your 3-rd semester GPA: "))
  84. num4 = float(input("Enter your 4-th semester GPA: "))
  85. num5 = float(input("Enter your 5-th semester GPA: "))
  86. num6 = float(input("Enter your 6-th semester GPA: "))
  87. a = float(num1 + num2 + num3 + num4 + num5 + num6)/6
  88. if a >= 3.5 :
  89. print ("Good job " + name + ", " + "your GPA is great!")
  90. if a > 3 and a <3.5 :
  91. print ("Nice, but I am sure you can do better," + " " + name + ".")
  92. if a <= 3 and a > 2 :
  93. print (name + " " + "don't give up! You should try harder!")
  94. if a <= 2 :
  95. print (name + " " + "you better work harder, or you will be on probation!")
  96. print(name + "'s" + " overall GPA is" + " " + str(a))
  97.  
  98. elif semester == 7 :
  99. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  100. num2 = float(input("Enter your 2-nd semester GPA: "))
  101. num3 = float(input("Enter your 3-rd semester GPA: "))
  102. num4 = float(input("Enter your 4-th semester GPA: "))
  103. num5 = float(input("Enter your 5-th semester GPA: "))
  104. num6 = float(input("Enter your 6-th semester GPA: "))
  105. num7 = float(input("Enter your 7-th semester GPA: "))
  106. a = float(num1 + num2 + num3 + num4 + num5 + num6 + num7)/7
  107. if a >= 3.5 :
  108. print ("Good job, " + name + ", " + "your GPA is great!")
  109. if a > 3 and a <3.5 :
  110. print ("Nice, but I am sure you can do better," + " " + name + ".")
  111. if a <= 3 and a > 2 :
  112. print (name + " " + "don't give up! You should try harder!")
  113. if a <= 2 :
  114. print (name + " " + "you better work harder, or you will be on probation!")
  115. print(name + "'s" + " overall GPA is" + " " + str(a))
  116.  
  117. elif semester == 8 :
  118. num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
  119. num2 = float(input("Enter your 2-nd semester GPA: "))
  120. num3 = float(input("Enter your 3-rd semester GPA: "))
  121. num4 = float(input("Enter your 4-th semester GPA: "))
  122. num5 = float(input("Enter your 5-th semester GPA: "))
  123. num6 = float(input("Enter your 6-th semester GPA: "))
  124. num7 = float(input("Enter your 7-th semester GPA: "))
  125. num8 = float(input("Enter your 8-th semester GPA: "))
  126. a = float(num1 + num2 + num3 + num4 + num5 + num6 + num7 + num8)/8
  127. if a >= 3.5 :
  128. print ("Good job, " + name + ", " + "your GPA is great!")
  129. if a > 3 and a <3.5 :
  130. print ("Nice, but I am sure you can do better," + " " + name + ".")
  131. if a <= 3 and a > 2 :
  132. print (name + " " + "don't give up! You should try harder!")
  133. if a <= 2 :
  134. print (name + " " + "you better work harder, or you will be on probation!")
  135. print(name + "'s" + " overall GPA is" + " " + str(a))
  136.  
  137. else:
  138. print "Please enter a valid semester number e.g. 1,2,3,...7,8"
  139.  
  140. import sys
  141. while True:
  142. print('Type q to exit.')
  143. response = input()
  144. if response == 'q':
  145. sys.exit()
  146. print('You typed ' + response + '.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement