Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE READ ASSIGNMENT instruction please java programming ( beginner way possible , still learning basics please Assignment 3 (HAS TWO Questions/programs) Question 1 ( 60
PLEASE READ ASSIGNMENT instruction please
Assignment 3 (HAS TWO Questions/programs) Question 1 ( 60 points) Decision or Selection Structures and Loops (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 569.50 Less than 20 MPH 59950 Less than 30 MPH $129.50 Less than 5 MP $149.50 Greater than or equal to 35 MPH Court Mandatory - Fine decided in court If you speed in construction zone your fine is doubled. If you speed in school zone your fine is tripled. Write a JAVA program to calculate the speeding fine speedFineCalcFirstname called from main. The variables in the program should be named and should be input by the user: speedlimitFirstname (Speed Limit of the zone as an int) speedFirstname // (Speed of the vehicle as an int) zoneFirstname // The acceptable values are Regular School or Construction. If any other value is entered use a while loop to make sure that a valid input is entered. The program also should display the following message for each of the above cases as shown in the table below: Less than 10 MPH Slow down. Less than 20 MPH Drive with caution! Less than 30 MPH You are in danger zone. Less than 35 MPH You are over speeding! Greater than or equal to 35 MPH See ya in court." Display also should specify whether in School or construction zone or regular Your function should calculate the fine and should do the display Function should not calculate any fine if the driver is driving within the speed limit and print a suitable message. (Following are examples which you can use for testing. Please do not code for these values. Program should be always general.) Fines should be calculated using an if-else if-else decision structure and make it more efficient by not repeating code as much as possible. Display Message should be displayed using a Switch - Case decision structure. For example your output should look like: Speed Limit: 45 Vehicle speed: 57 Zone: Regular Total Fine Calculated = $99.50 speed LimitFirstname //(Speed Limit of the zone as an int) speedFirstname // (Speed of the vehicle as an int) zone Firstname // The acceptable values are Regular, School or Construction. If any other value is entered use a while loop to make sure that a valid inpur is entered. The program also should display the following message for each of the above cases as shown in the table below: Less than 10 MPH Slow down. Less than 20 MPH Drive with cautio, Less than 30 MPH You are in danger moet Less than 35 MPH You are overspoeling! Greater than er equal to 35 MPH See ya in coun." Display also should specify whether in School or construction zone or regular Your function should calculate the fine and should do the display. Function should not calculate any fine if the driver is driving within the speed limit and print a suitable message. (Following are examples which you can use for testing. Please do not code for these values. Program should be always general.) Fines should be calculated using an if-else if-else decision structure and make it more efficient by not repeating code as much as possible. Display Message should be displayed using a Switch - Case decision structure. For example your output should look like: Speed Limit: 45 Vehicle speed: 57 Zone: Regular Total Fine Calculated $99.50 Display: "Drive with Caution.!" OR like: Speed Limit: 45 Vehicle speed: 67 Zone: Construction Total Fine Calculated - $259.00 Display: "You are in danger zone. !". OR like: Speed Limit: 45 Vehicle speed: 67 Zone: School Total Fine Calculated=5388.50 Display: "You are in danger zone java programming ( beginner way possible , still learning basics please
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