Question: Please use the simplest code... Assignmnent 3: Decision Structures Due Date: 05/07/2018 (Decision Tree) The fines for Speeding in one of the counties in Florida

Please use the simplest code...

Assignmnent 3: Decision Structures Due Date: 05/07/2018

(Decision Tree) The fines for Speeding in one of the counties in Florida is given in the following table.

MPH Over Speed Limit

Fine

Less than 10 MPH

$129.00

Less than 15 MPH

$204.00

Less than 20 MPH

$254.00

Less than 30 MPH

$279.00

Greater than or equal to 30 MPH

Court Mandatory

If you speed in school or construction zone your fine is doubled.

Write a Java program to calculate the speeding fine and display the speeding fine as output.

Create a Class with YourLastNameSpeedLimit

Use an if else if else loop to calculate the speeding fine.

Also consider the case where the driver is driving within the speed limit.

The program should ask the user to input the following three variables (Use Scanner).

Speed Limit,

Speed of the vehicle and

Whether construction or school zone (This could be a yes or no or a Y or N, You need to specify to the user what they should input).

Once the inputs are entered the program should calculate the speeding fines.

Example 1:

Speed Limit in MPH: 45

Vehicle speed in MPH: 57

Construction or School Zone: No

Total Fine Calculated = $204.00

Example 2:

Speed Limit in MPH: 45

Vehicle speed in MPH: 57

Construction or School Zone: Yes

Total Fine Calculated = $408.00

Assignmnent 3: Decision Structures Due Date: 05/07/2018

(Decision Tree) The fines for Speeding in one of the counties in Florida is given in the following table.

MPH Over Speed Limit

Fine

Less than 10 MPH

$129.00

Less than 15 MPH

$204.00

Less than 20 MPH

$254.00

Less than 30 MPH

$279.00

Greater than or equal to 30 MPH

Court Mandatory

If you speed in school or construction zone your fine is doubled.

Write a Java program to calculate the speeding fine and display the speeding fine as output.

Create a Class with YourLastNameSpeedLimit

Use an if else if else loop to calculate the speeding fine.

Also consider the case where the driver is driving within the speed limit.

The program should ask the user to input the following three variables (Use Scanner).

Speed Limit,

Speed of the vehicle and

Whether construction or school zone (This could be a yes or no or a Y or N, You need to specify to the user what they should input).

Once the inputs are entered the program should calculate the speeding fines.

Example 1:

Speed Limit in MPH: 45

Vehicle speed in MPH: 57

Construction or School Zone: No

Total Fine Calculated = $204.00

Example 2:

Speed Limit in MPH: 45

Vehicle speed in MPH: 57

Construction or School Zone: Yes

Total Fine Calculated = $408.00

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!