Question
Speeding Fine Calculator You have been hired by the police department of the city you live in to create a program to calculate the fine
Speeding Fine Calculator
You have been hired by the police department of the city you live in to create a program to calculate the fine that a motorist could pay. If the motorist was travelling at or below the speed limit, there is no fine. If the motorist is travelling over the speed limit, the amount of the fine is determined based on the table below. The speed limit that will be entered is a multiple of 5 from 5 to 85.
For example, if the speed limit was 30 and the speed measured was 34, the motorist was travelling 13.33% [ (34 - 30) / 30 ] over the speed limit. From the table, a motorist travelling 13.33% over the speed limit of 30 is liable for a fine of $180.
Percentage over Speed Limit | ||||
---|---|---|---|---|
Speed Limit | Less than 5% | 5% - Less than 10% | 10% - Less than 25% | 25% or more |
25 or lower | 70 | 85 | 120 | 180 |
26 - 45 | 85 | 120 | 180 | 250 |
46 - 65 | 100 | 150 | 200 | 300 |
Over 65 | 150 | 200 | 300 | 500 |
The program will prompt for the speed limit and the actual speed the motorist was measured travelling. When the information is entered, the program will determine whether a fine is due or not and if a fine is due, what the fine amount is. The posted speed limit will always be a whole number.
Write pseudocode for the program and then code the pseudocode using the Python programming
- Pseudocode file (e.g. speedingfinecalculator.txt)
- Python program (e.g. speedingfinecalculator.py
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started