-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeedticket.py
More file actions
25 lines (17 loc) · 859 Bytes
/
speedticket.py
File metadata and controls
25 lines (17 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#This program will calculate if you will recieve a speed limit ticket and the price.
#By Neemias Moreira
def main():
print("This program will say if your speed was legal or illegal and will print the value of the ticket.")
speed_limit = float(input("\nWhat is the speed limit?: "))
speed = float(input("\nWhat was your speed?: "))
if speed <= speed_limit:
print("\nYour velocity is legal.")
elif speed > 90:
print("\nYour speed was illegal.")
fine = 250 + ((speed - speed_limit) * 5)
print ("The value of your Speeding Ticket is, $ ", fine, "Dollars.")
elif speed > speed_limit:
print("\nYour speed was illegal.")
fine = 50 + ((speed - speed_limit) * 5)
print ("The value of your Speeding Ticket is, $ ", fine, "Dollars.")
main()