Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help me with this Java lab specifically with adding the extra methods and calling them Scenario: The town of Speedtrap, Oklahoma,gives out lots of
please help me with this Java lab specifically with adding the extra methods and calling them
Scenario: The town of Speedtrap, Oklahoma,gives out lots of speeding tickets. Speedtrap just passed a new speeding ticket fine ordinance. If you are stopped going over the speed limit, but less than 15 mph over, the fine is $250. If you're 15 mph over, but less than 30 mph over, the fine is $350. If you're 30 mph or more over the speed limit, the fine is $450. If you have had 2 or more tickets in the past year (previous to this one). you pay a penalty of one-third of your regular fine. This penalty is calculated before the reckless driving penalty, below If you're more than 40 miles over the limit, you also get a reckless driving charge. This is bad. This penalty is equal to $150 for each mile per hour you are over the 40 miles over the limit. For example, if you're 45 mph over the limit, your penalty would be 5. 150. Create a program that will allow the officer to enter three things. Inputs should happen in your main() method. 1. The speed limit 2. The driver's actual speed 3. The number of previous tickets. Then expand your program to calculate the amount of their fine. In addition to main, you should have methods calcFine calculates and returns the amount of the fine. calePenalty calculates and returns the amount of the penalty calcReckless calculates and returns the amount of the reckless driving penalty It should then display the following Fine Penalty Reckless Driving Total due Sxx, XXX.XX $xx, xxx.xx Sxx, XXX.XX Sxx, xxx.xx 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