Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.66 KB | None | 0 0
  1. print("MSU Undergraduate Tuition Calculator.")
  2. print("")
  3.  
  4. # Chunk below establishes strings, defines strings, and defines ints
  5. YES = "yes"
  6. NO = "no"
  7. FRESHMAN = "freshman"
  8. SOPHOMORE = "sophomore"
  9. JUNIOR = "junior"
  10. SENIOR = "senior"
  11. main_loop = 0 # Broken at end
  12. grade_loop = 0 # Needs to be reset
  13. credit_loop = 0 # Needs to be reset
  14. college = "" # Needs to be reset
  15. COE_admit = "" # Needs to be reset
  16. grade = "" # Needs to be reset
  17. ENGINEERING = "engineering"
  18. HEALTH = "health"
  19. SCIENCES = "sciences"
  20. BUSINESS = "business"
  21. CMSE = "cmse"
  22. NONE = "none"
  23. is_JMC = "" # NEEDS TO BE RESET
  24. ASMU_TAX = 21
  25. RADIO_TAX = 3
  26. is_international = "" #RESET
  27. major = "" # NEEDS TO BE RESET
  28. is_resident = ""
  29.  
  30. while main_loop == 0:
  31. # Chunk below asks if user is resident and international if necessary
  32. resident_ask = input("Resident (yes/no): ")
  33. if resident_ask.lower() == YES:
  34. is_resident = YES
  35. elif resident_ask.lower() == NO or resident_ask.lower() != YES:
  36. is_resident = NO
  37. inter_ask = input("International (yes/no): ")
  38. if inter_ask.lower() == YES:
  39. is_international = YES
  40. elif inter_ask.lower() == NO or inter_ask.lower() != NO:
  41. is_international = NO
  42. # Loop below asks for grade until valid one is entered
  43. while grade_loop != 1:
  44. grade_ask = input("Level—freshman, sophomore, junior, senior: ")
  45. if grade_ask.lower() == FRESHMAN:
  46. grade = grade + FRESHMAN
  47. print(grade)
  48. grade_loop = 1
  49. elif grade_ask.lower() == SOPHOMORE:
  50. grade = grade + SOPHOMORE
  51. grade_loop = 1
  52. elif grade_ask.lower() == JUNIOR:
  53. grade = grade + JUNIOR
  54. grade_loop = 1
  55. elif grade_ask.lower() == SENIOR:
  56. grade = grade + SENIOR
  57. grade_loop = 1
  58. else:
  59. print("Invalid input. Try again.")
  60. # Chunk below asks user about college they are in and assigns major
  61. if grade == SENIOR or grade == JUNIOR:
  62. college_ask = input("Enter college as business, engineering, health, sciences, or none:\n")
  63. college = college + college_ask
  64. if college.lower() == ENGINEERING:
  65. major = major + ENGINEERING
  66. elif college.lower() == BUSINESS:
  67. major = major + BUSINESS
  68. elif college.lower() == HEALTH:
  69. major = major + HEALTH
  70. elif college.lower() == SCIENCES:
  71. major = major + SCIENCES
  72. print("Is your major CMSE (\"Computational Mathematics and Engineering\")")
  73. is_cmse = input("(yes/no): ")
  74. if is_cmse.lower() == YES:
  75. major = major + CMSE
  76. elif major != ENGINEERING and major != BUSINESS and major != HEALTH and major != SCIENCES and major != CMSE:
  77. major = major + NONE
  78. if major == NONE or major == CMSE:
  79. JMC_ask = input("Are you in the James Madison College (yes/no): ")
  80. if JMC_ask.lower() == YES:
  81. is_JMC = YES
  82. elif JMC_ask.lower() == NO or JMC_ask.lower() != YES:
  83. is_JMC = NO
  84.  
  85. elif grade == FRESHMAN or SOPHOMORE:
  86. is_COE_admit = input("Are you admitted to the College of Engineering (yes/no) ")
  87. if is_COE_admit.lower() == YES:
  88. COE_admit = COE_admit + YES
  89. elif is_COE_admit.lower() == NO or is_COE_admit.lower() != YES:
  90. COE_admit = COE_admit + NO
  91. if COE_admit == NO:
  92. JMC_ask = input("Are you in the James Madison College (yes/no): ")
  93. if JMC_ask.lower() == YES:
  94. is_JMC = YES
  95. elif JMC_ask.lower() == NO or JMC_ask.lower() != YES:
  96. is_JMC = NO
  97. # Chunk below calculates credits
  98. while credit_loop != 1:
  99. credit_ask = input("Credits: ")
  100. if credit_ask.isdigit() == True:
  101. credits = int(credit_ask)
  102. if credits > 0:
  103. credits = credits
  104. credit_loop = 1
  105. elif credits <= 0:
  106. print("Invalid Input. Try Again.")
  107. else:
  108. print("Invalid Input. Try Again.")
  109. # Chunk below calculates Tuition
  110. cost = 0
  111. # Student Voted Costs
  112. cost = ASMU_TAX + RADIO_TAX
  113. if is_JMC == YES:
  114. cost = cost + 7.5
  115. else:
  116. cost = cost
  117. if credits >= 6:
  118. cost = cost + 5
  119. # Special Fees for international
  120. if is_international == YES and credits <= 4:
  121. cost = cost + 375
  122. elif is_international == YES and credits >4:
  123. cost = cost + 750
  124. # Special Fees for CMSE
  125. if major == CMSE and credits <= 4:
  126. cost = cost + 402
  127. elif major == CMSE and credits > 4:
  128. cost = cost + 670
  129. # Special fees for sciences
  130. if major == SCIENCES and credits <= 4:
  131. cost = cost + 50
  132. elif major == SCIENCES and credits > 4:
  133. cost = cost + 100
  134. # Special fees for health
  135. if major == HEALTH and credits <= 4:
  136. cost = cost + 50
  137. elif major == HEALTH and credits > 4:
  138. cost = cost + 100
  139. # Special fees for business
  140. if major == BUSINESS and credits <= 4:
  141. cost = cost + 113
  142. elif major == BUSINESS and credits > 4:
  143. cost = cost + 226
  144. # Special fees for college of engineering
  145. if COE_admit == YES and credits <= 4:
  146. cost = cost + 402
  147. elif COE_admit == YES and credits > 4:
  148. cost = cost + 670
  149. # Core costs [FRESHMAN]
  150. elif grade == FRESHMAN and credits < 12 and is_resident == YES:
  151. cost = cost + (credits * 482)
  152. print("a")
  153. elif grade == FRESHMAN and credits > 11 and credits < 19 and is_resident == YES:
  154. cost = cost + 7230
  155. print("b")
  156. elif grade == FRESHMAN and credits > 18 and is_resident == YES:
  157. cost = cost + 7230 + ((credits-18)*482)
  158. print("c")
  159. elif grade == FRESHMAN and credits < 12 and is_resident == NO:
  160. cost = cost + (credits * 1325.5)
  161. print("d")
  162. elif grade == FRESHMAN and credits > 11 and credits < 19 and is_resident == NO:
  163. cost = cost + 19883
  164. print("e")
  165. elif grade == FRESHMAN and credits > 18 and is_resident == NO:
  166. cost = cost + 19883 + ((credits-18)*1325.5)
  167. print("f")
  168. # Core costs [SOPHOMORE]
  169. elif grade == SOPHOMORE and credits < 12 and is_resident == YES:
  170. cost = cost + (credits * 494)
  171. elif grade == SOPHOMORE and credits > 11 and credits < 19 and is_resident == YES:
  172. cost = cost + 7410
  173. elif grade == SOPHOMORE and credits > 18 and is_resident == YES:
  174. cost = cost + 7410 + ((credits - 18) * 494)
  175. ("this")
  176. elif grade == SOPHOMORE and credits < 12 and is_resident == NO:
  177. cost = cost + (credits * 1325.5)
  178. elif grade == SOPHOMORE and credits > 11 and credits < 19 and is_resident == NO:
  179. cost = cost + 19883
  180. elif grade == SOPHOMORE and credits > 18 and is_resident == NO:
  181. cost = cost + 19883 + ((credits - 18) * 1325.5)
  182. # Core costs [JUNIOR and SENIOR]
  183. if grade == JUNIOR and credits < 12 and is_resident == YES and major != BUSINESS and major != ENGINEERING and major != BUSINESS:
  184. cost = cost + (credits * 555)
  185. elif grade == JUNIOR and credits > 11 and credits < 19 and is_resident == YES and major != BUSINESS and major != ENGINEERING:
  186. cost = cost + 8325
  187. elif grade == JUNIOR and credits > 19 and is_resident == YES and major != BUSINESS and major != ENGINEERING:
  188. cost = cost + 8325 + ((credits-18)*555)
  189. print(3)
  190. elif grade == JUNIOR or grade == SENIOR and credits < 12 and is_resident == NO and major != BUSINESS and major != ENGINEERING:
  191. cost = cost + (credits * 1366.75)
  192. print(4)
  193. elif grade == JUNIOR or grade == SENIOR and credits > 11 and credits < 19 and is_resident == NO and major != BUSINESS and major != ENGINEERING:
  194. cost = cost + 20501
  195. print(5)
  196. elif grade == JUNIOR or grade == SENIOR and credits > 19 and is_resident == NO and major != BUSINESS and major != ENGINEERING:
  197. cost = cost + 20501 + ((credits-18)*1366.75)
  198. print(6)
  199. elif grade == JUNIOR or grade == SENIOR and credits < 12 and is_resident == YES and major == BUSINESS or major == ENGINEERING:
  200. cost = cost + (credits * 555)
  201. print(7)
  202. elif grade == JUNIOR and credits > 11 and credits < 19 and is_resident == YES and major == BUSINESS:
  203. cost = cost + 8325
  204. print(8)
  205. elif grade == JUNIOR or grade == SENIOR and credits > 19 and is_resident == YES and major == BUSINESS or major == ENGINEERING:
  206. cost = cost + 8325 + ((credits - 18) * 555)
  207. print(9)
  208. elif grade == JUNIOR or grade == SENIOR and credits < 12 and is_resident == NO and major == BUSINESS or major == ENGINEERING:
  209. cost = cost + (credits * 1366.75)
  210. print(10)
  211. elif grade == JUNIOR or grade == SENIOR and credits > 11 and credits < 19 and is_resident == NO and major == BUSINESS or major == ENGINEERING:
  212. cost = cost + 20501
  213. print(11)
  214. elif grade == JUNIOR or grade == SENIOR and credits > 19 and is_resident == NO and major == BUSINESS or major == ENGINEERING:
  215. cost = cost + 20501 + ((credits - 18) * 1366.75)
  216. print(12)
  217. #Chunk below prints out tuition cost
  218. tuiton = '${:,.2f}'.format(cost)
  219. print("Tuition is ", tuiton)
  220. go_again = input("Do you want to do another calculation (yes/no): ")
  221. if go_again.lower() == YES:
  222. grade_loop = 0
  223. grade = ""
  224. credit_loop = 0
  225. is_JMC = ""
  226. major = ""
  227. COE_admit = ""
  228. is_international = ""
  229. college = ""
  230. cost = 0
  231. is_resident = ""
  232. elif go_again.lower() == NO:
  233. main_loop = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement