Westonci.ca is the ultimate Q&A platform, offering detailed and reliable answers from a knowledgeable community. Connect with professionals ready to provide precise answers to your questions on our comprehensive Q&A platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

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 hope our answers were useful. Return anytime for more information and answers to any other questions you have. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.