Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Speeding Fines Current penalties for individuals caught speeding in Queensland are: table [ [ Infringement , Penalty amount,Demerit points ] , [ Less than
Speeding Fines
Current penalties for individuals caught speeding in Queensland are:
tableInfringementPenalty amount,Demerit pointsLess than over the speed limit$At least but not more than over the speed limit$More than but not more than over the speed limit$More than but not more than over the speed limit$More than over the speed limit$
Note: the way the government website has written this and we've copied it is NOT efficient in terms of decision structures. This has been written for each condition to stand alone if if if but we can tell this is mutually exclusive, so we know a better tool for the job, don't we
Avoid a month suspension by writing a program to ask for the user's:
speed and the
speed limit
then tell them their fine in dollars you can ignore the demerit points
After getting the inputs, you will want to calculate the speed over the limit You do not want to calculate this again and again in each condition. DRY.
Before you finish this question, check again for any "DRY" issues.
Can you improve your code?
Plays Used python
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