Question: The speed limit for the unit is set by an operator when the device is installed. The citation is a message determined by the speed.

The speed limit for the unit is set by an operator when the device is installed. The citation is a message determined by the speed.

Speed Over Limit Message
Up to 3mph Compliant
3mph - 8mph Warning
Over 8mph Fine

When a fine is issued, the amount is calculated as $50 + \$5 for each mph over the limit, with a cap at $200. Fines are doubled if you are in a construction zone (for a max of \$400).

Write a function called generate_citation to determine the appropriate message to send to DoT.

  • The function should accept parameters for the: License Plate number, speed, speed Limit, and whether or not it is a construction zone.

    • It should NOT prompt the user for input.
  • The function should return a single string value that contains the details of the citation. The string should combine the Plate Number, the citation message, and the fine. (Note when the message is "Compliant" or "Warning", the fine is omitted.

Problem 2

Write a new function that simulates at least 6 cars going past the ATE. This can be as simple as a function that calls your function made above 6 times, or you could use a loop. Either way, you should include a diversity of outcomes to demonstrate that your code is working correctly.

Important Note: we are using the programming language python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!