Advertisement
GregroxMun

WIP Midterm

Oct 2nd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. def main():
  2. name = input("what's your name? ")
  3. violations = violation()
  4. age = userAge()
  5.  
  6. if age < 25:
  7. if violations >= 4:
  8. riskCode = 1
  9. risk = 'high'
  10. InsurancePrice = '$480.00'
  11. elif violations == 3:
  12. riskCode = 2
  13. risk = 'moderate'
  14. InsurancePrice = '$450.00'
  15. elif violations == 2:
  16. riskCode = 2
  17. risk = 'moderate'
  18. InsurancePrice = '$405.00'
  19. elif violations == 1:
  20. riskCode = 3
  21. risk = 'low'
  22. InsurancePrice = '$380.00'
  23. elif violations == 0:
  24. riskCode = 4
  25. risk = 'no'
  26. InsurancePrice = '$325.00'
  27. else:
  28. if violations >= 4:
  29. riskCode = 1
  30. risk = 'high'
  31. InsurancePrice = '$410.00'
  32. elif violations == 3:
  33. riskCode = 2
  34. risk = 'moderate'
  35. InsurancePrice = '$390.00'
  36. elif violations == 2:
  37. riskCode = 2
  38. risk = 'moderate'
  39. InsurancePrice = '$365.00'
  40. elif violations == 1:
  41. riskCode = 3
  42. risk = 'low'
  43. InsurancePrice = '$315.00'
  44. elif violations == 0:
  45. riskCode = 4
  46. risk = 'no'
  47. InsurancePrice = '$275.00'
  48.  
  49. print(name,InsurancePrice,riskCode,risk)
  50.  
  51. def userAge():
  52. age = int(input("What is your age? "))
  53. return age
  54.  
  55. def violation():
  56. violations = int(input("how many violations do you have? "))
  57. return violations
  58.  
  59.  
  60.  
  61. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement