...

Exercise: Speed Limits 2

The program you created for law enforcement in the last exercise has been a huge success! However, you have received feedback that it only works on roads with a speed limit of 55.

In this exercise, you will enhance the program to work with any speed limit. You will take speed and speedLimit as inputs, and write an output message based on how much over the speed limit the driver was going:

  • At or below limit: "Safe driving! No violation."
  • 1-5 over: "Just over the limit. Issue a warning."
  • 5-10 over: "Minor speeding violation. Issue a small fine."
  • 11-20 over: "Serious speeding! Issue a large fine."
  • 21+ over: "Major violation! Issue a hefty fine and consider suspending license."

Variables

No variables

Loading...

Output (Console)