#speeding /isurance problem 3 from the lab 7 #Discussion: #Input: current, limit, cost all integers #Calculartions: if-elif-else statement #incr - percent increase of insurance #new_rate=cost+cost*incr/100 #monthly=new_rate/12 current=int(input("enter current speed ")) limit=int(input("enter speed limit ")) cost=int(input("cost of insurance per year ")) diff=current-limit if(diff>=25): incr = -1 points=-1 elif(diff>=20): incr = 20 points=4 elif(diff>=15): incr = 15 points=3 elif(diff>=10): incr = 10 points=2 elif(diff>=1): incr=5 points=1 else: incr=0 points=0 if(incr>0): new_rate=cost+cost*incr/100 monthly=new_rate/12 print(points, "points") print(incr, "increase percent") print("new rate", new_rate) print("monthly", monthly) elif(incr==0): print("no points, no increase") new_rate=cost+cost*incr/100 monthly=new_rate/12 print("new rate", new_rate) print("monthly", monthly) else: print("lost license") #Test 1: current = 120, limit = 65, cost=1000. Output: lost license #Test 2: current = 85 limit 65 cost=1000. Output: 4 points, 20 increase #1200 new rate, 100 monthly #Test 3: current = 85 limit = 70 cost 5000. Output: 3 points, 15 #increase new_rate=5000+5000*15/100=5750 montly=479.17 #Test 4: current=65 limit=55 cost=1000 #output 2 points 10% increase #new_rate=1000+1000*10/100=1100 monthly= 91.67 #Test 5: current = 47 limit=45 cost 1000 #output: 1 point 5% increase new_rate=1050 #monthly=87.50 #Test 6: current = 35 limit=45 cost 1000 #no points new_rate=1000, monthly=83.33