Question

In: Computer Science

At L's Insurance Company, a surcharge (an extra cost) is added to the insurance premium if...

At L's Insurance Company, a surcharge (an extra cost) is added to the insurance premium if the driver has points on his or her license. If the driver has no points, there is no surcharge. If the driver has 1 to 4 points, the surcharge is 8% of the insurance premium. If the driver has 5 to 8 points, the surcharge is 15% of the insurance premium. If the driver has 9 points, the surcharge is 18% of the insurance premium. If the driver has 10 or more points, the surcharge is 23% of the insurance premium. Write a complete Java program that includes the statements to read in the insurance premium and the number of points from the keyboard using the Scanner class. The program should then calculate the surcharge and the total cost, which is the sum of the premium and the surcharge. Use constants where applicable and format your output with System.out.printf method.

Class Name: InsuranceCost

Sample Output:

Enter insurance premium amount: #####

Enter the number of points you have: ##

Your surcharge is: $###,###.##

Your total cost for insurance is: $###,###.##

Solutions

Expert Solution

import java.util.*;
public class InsuranceCost
{
        public static void main(String[] args) {
            Scanner s=new Scanner(System.in);
                System.out.print("Enter Insurance Premium cost : ");
                int premium=s.nextInt(); //prompt user to enter premium
                System.out.print("Enter the number of points you have: ");
                int point=s.nextInt();  //prompt user to enter points
                double surcharge=0;
                if(point>0 && point<5)                 //check condition
                surcharge=premium*0.08;
                if(point>=5 && point<9)                //check condition
                surcharge=premium*0.15;
                if(point==9)                           //check condition
                surcharge=premium*0.18;
                if(point>=10)                          //check condition
                surcharge=premium*0.23;
                System.out.println();
                System.out.print("Your Surcharge is: " +surcharge);   //output result
                System.out.println();
                System.out.print("The total cost is: " +(premium+surcharge));//output result
                
        }
}

The above program stimulates all the requirements mentioned in the question in Java programing language.


Related Solutions

For life insurance policies, some of the premium pays for the cost of the insurance, and...
For life insurance policies, some of the premium pays for the cost of the insurance, and the remainder goes toward the cash value of the policy and earns interest like a savings account. Consider the following insurance company options. Company 1: pays 4.9% compounded monthly on the cash value of their policies Company 2: pays 4.93% compounded semiannually on the cash value of their policies What is the APY offered by each company? (Round your answers to the nearest hundredth.)...
The annual insurance premium for the factory building would be a: a. fixed cost, period cost,...
The annual insurance premium for the factory building would be a: a. fixed cost, period cost, and indirect cost with regard to units of product. b. fixed cost, product cost, and direct cost with regard to units of product. c. variable cost, product cost, and direct cost with regard to units of product. d. fixed cost, product cost, and indirect cost with regard to units of product.
Actuaries at an insurance company must determine a premium for the type of insurance. A random...
Actuaries at an insurance company must determine a premium for the type of insurance. A random sample of 40 potential purchasers of this type of insurance were foundto have suffered the following values of losses (in dollars) during the past year. These losses would have been covered by the insurance if it were not available. 100 32 0 0 470 50 0 14589 212 93 0 0 1127 421 0 87 135 420 0 250 12 0 309 0 177...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a zero NPV for both the insured and the insurer. As such, the present value of the expected loss is the actuarially fair insurance premium. Suppose your company wants to insure a building worth $245 million. The probability of loss is 1.25 percent in one year, and the relevant discount rate is 4 percent. a. What is the actuarially fair insurance premium? (Do not round...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a zero NPV for both the insured and the insurer. As such, the present value of the expected loss is the actuarially fair insurance premium. Suppose your company wants to insure a building worth $460 million. The probability of loss is 1.30 percent in one year, and the relevant discount rate is 2.1 percent. a. What is the actuarially fair insurance premium? (Do not round...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a zero NPV for both the insured and the insurer. As such, the present value of the expected loss is the actuarially fair insurance premium. Suppose your company wants to insure a building worth $295 million. The probability of loss is 1.28 percent in one year, and the relevant discount rate is 3.2 percent.    a. What is the actuarially fair insurance premium? (Enter your...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a...
In calculating insurance premiums, the actuarially fair insurance premium is the premium that results in a zero NPV for both the insured and the insurer. As such, the present value of the expected loss is the actuarially fair insurance premium. Suppose your company wants to insure a building worth $280 million. The probability of loss is 1.44 percent in one year, and the relevant discount rate is 3.6 percent.    a. What is the actuarially fair insurance premium? (Enter your...
An insurance company charges an annual premium of $75 for a $200,000 insurance policy against a...
An insurance company charges an annual premium of $75 for a $200,000 insurance policy against a house burning down. If the (empirical) probability that a house burns down in a given year is .0003, what is the expected value of the policy to the insurance company?
Write a program to determine the cost of an automobile insurance premium, based on the driver's...
Write a program to determine the cost of an automobile insurance premium, based on the driver's age and the number of accidents that the driver has had. The basic insurance charge is $500.There is a surcharge of $100. if the driver is under 25 and an additional surcharge for accidents: No. of accidents ► Accident Surcharge 1 ► 25 2 ► 25 3 ► 75 4 ► 75 5 ► 100 6 or + ► No assurance
A firm owns a building worth 1,500,000. The premium for insurance on the building will cost...
A firm owns a building worth 1,500,000. The premium for insurance on the building will cost $50,000.00. Expected annual losses on the building is $30,000. The firm would earn 14% on funds applied to operations. Invested reserves earn 4%. What is the true cost of retaining the risk of loss on its building, including opportunity costs. Explain your answer and show your work.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT