Hi ,I need assistance with my assignment. Please help me out here .I would like it to be done so I can later onwards compare it to mine and see where I got the code wrong and try to make it better for next time.
//This program will help customers estimate insurance premiums based on the number of accidents that the driver has caused. import java.util.Scanner; import java.util.Random; public class InsurancePremium { public static void main(String[] args ) { //Declare variables Scanner keyboard = new Scanner(System.in); //For getting user input Random accidents = new Random();//Generate random input for accidents String runProgram = " "; int years = 0; double insurancePremium = 0.0;//The amount the user is going to input double increaseInPremium = 0.0;//The additional increase required to be paid over the insurance cost final double fiveYearIncrease = 0.10;//The .10% required to be paid by the end of every 5th year regardless of # of accidents //Display System.out.println("Welcome to Plees, Charge, and Moore Insurance Estimator.This program helps to estimate insurance premiums over a period of 30 years, given the following rules:"); System.out.println("Please enter fenderBender to start the program or no to quit. "); runProgram = keyboard.nextLine(); runProgram = runProgram.toLowerCase(); //Create loops for providing statements while (runProgram.equals("fenderbender")) { //Getting input from the user System.out.println("Please enter Insurance Premium for Year 1:"); insurancePremium = keyboard.nextDouble(); System.out.println("For how many years shall we calculate your premium ?"); years = keyboard.nextInt(); for (int i = 1; i <=accidents; i++)="" {="" break="" if="" (="" accidents="">=4) { System.out.println("Sorry , 4 accidents mean we drop you as a client."); break; } //else //{ //System.out.println(" //}//end of if to break at 105000 //if //{ //System.out.println(""); //System.out.println(""); //System.out.println(""); }//end of if }//end of for //System.out.printf("") System.out.print("Enter fenderbender if you want to run the program again"); System.out.println(" or STOP to quit."); runProgram = keyboard.nextLine(); runProgram = runProgram.toLowerCase(); }//end of while }//end of main }//end of class ITP 120 Programming Assignment 1 Due Sunday, September 26, 2021 at 11:59 PM. If you miss the deadline, send email for a makeup. This counts 130 points of your overall grade. We will go through a program that is very much like it for practice. This program assesses your ability to work with decision structures, loops, the random function, print formatting, and basic mathematical operations, + - * % You are developing an application for the Plees, Charge, and Moore Insurance Company to help customers estimate insurance premiums that change from one year to the next over a period of 20 years based on the number of accidents that the driver has caused. The rules are as follows: #Accidents Premium +/- 0 -10% 1 +10% 2 +20% 3 +50% 4 or more drop client Since no one really knows how many accidents they may cause in a given year, we are going to use the random function to generate an integer between 0 and 4 to represent the number of accidents for each year. (We are hoping and assuming that no one will have more than 4 accidents.) The company has a policy of increasing the premium at the end of every 5th year by 10% after adjusting for the increase or decrease arising from the number of accidents for that year assuming that the client is not being dropped for any reason. As an example, if at the beginning of Year 5, the premium is 1336.50 and the driver has 2 accidents, then the change in premium arising from accidents will be calculated by taking the premium of 1336.50 * .20 to get 267.30. Then, add the premium of 1336.50 to the change arising from accidents of 267.30 to get 1603.80. Then, multiply the 1603.80 * .10 to get the 5 year increase which gives us 160.38. Finally, add the 267.30 change to the 160.38 increase to get the change of 427.68 at the end of Year 5. To summarize, the premium of 1336.50 at the beginning of Year 5 will have a 427.68 premium increase at the end of Year 5 which causes the premium at the beginning of Year 6 to be 1764.18. When the client is dropped, please display a message to let them know why they were dropped. See the test runs for display messages to use when dropping clients. Here is how the program should run given several different scenarios. Take note that a sentinel value loop will control the program by asking the user to enter FenderBender to run the program or No to quit. The table displaying the premiums will require either a for loop or counter controlled loop. A decision structure based on number of accidents will set the premiums. An if statement can be used to break out of the loop when 4 accidents in a single year are recorded. An if statement can be used to divide the years by 5 using the modulus operator to see if the remainder is a 0, and it is at that point that the 5 year increase can occur. Please use print formatting to create the table columns, the + or – sign to show the change in premium, and display 2 decimal points for all monetary amounts: Remember that because we are using a random function to generate the number of accidents, your results will differ from mine. You will need to use a calculator to verify the accuracy of your results for each year. User input is shown in RED below: Welcome to Plees, Charge, and Moore Insurance Estimator This program helps to estimate insurance premiums over a period of 30 years, given the following rules: #Accidents Premium +/- 0 -10% 1 +10% 2 +20% 3 +50% 4 or more drop client Please enter FenderBender to start the program again or No to quit. fenderbender Please enter the insurance premiusm for Year 1: 1000 ********** Plees, Charge, and Moore Insurance ********** Year Beginning Premium Accidents Premium +/- 1 1000.00 3 +500.00 2 1500.00 4 N/A Sorry, 4 accidents mean we drop you as a client. Please enter FenderBender to start the program again or No to quit. fenderBender Please enter the insurance premiusm for Year 1: 1000 ********** Plees, Charge, and Moore Insurance ********** Year Beginning Premium Accidents Premium +/- 1 1000.00 3 +500.00 2 1500.00 3 +750.00 3 2250.00 0 -225.00 4 2025.00 1 +202.50 5=accidents;>