Experience the power of community-driven knowledge on IDNLearn.com. Our platform provides prompt, accurate answers from experts ready to assist you with any question you may have.

write a program that is given two integers representing a speed limit and driving speed in miles per hour (mph), calls the function calculate ticket cost() and outputs the traffic ticket amount.

Sagot :

The program that is given two integers representing a speed limit and driving speed in miles per hour is given below:

The Program

def ask_limit():

  limit = float(input ("What was the speed limit? "))

   return limit

def ask_speed():

   speed = float(input ("What was your clocked speed? "))

   return speed

def findfine(speed, limit):

   if speed > 90:

       bigfine = ((speed - limit) * 5 + 250)

       print "your fine is", bigfine

   elif speed <= limit:

       print "you were traveling a legal speed"

   else:

       fine = ((speed - limit) * 5 + 50)

       print "your fine is", fine

def main():

  limit = ask_limit()

   speed = ask_speed()

   findfine(speed, limit)

main()

Read more about computer programs here:

https://brainly.com/question/23275071

#SPJ1

We appreciate your contributions to this forum. Don't forget to check back for the latest answers. Keep asking, answering, and sharing useful information. IDNLearn.com is your go-to source for accurate answers. Thanks for stopping by, and come back for more helpful information.