Question

In: Computer Science

Des/ign, implement, (Auto, Home, Life) as classes and test them, that represent different insurance policies.


Des/ign, implement, (Auto, Home, Life) as classes and test them, that represent different insurance policies. A policy contains information used by an insurance company to provide financial assi/stance in the event of an accident. It also contains information used to compute how much money, also called acommission. Develop instance variables, constructors, get/set methods, and a toString method for each class. Create a driver class called PolicyTest, whose main method creates objects from each type of class, sets each object with sample data for the information below, and prints the commis/sion totals based on the formulas below. You are not required to prompt a user for the information in this.

Auto insurance policy

Policy information includes:
    - name of insured
    - make and model of automobile
    - amount of liability coverage in dollars
    - amount of collision coverage in dollars
Sales commission is based on the formula:

commission = (liability + collision) * 30%


Home insurance policy

Policy information includes:
    - name of insured
    - house square footage
    - amount of dwelling coverage in dollars
    - amount of contents coverage in dollars
    - amount of liability coverage in dollars
Sales commission is based on the formula:
commission = (liability * 30%) + ( (dwelling + contents) * 20% )


Life insurance policy

Policy information includes:
    - name of insured
    - age of insured
    - amount of term life coverage in dollars
Sales commission is based on the following formula:
commission = term life * 20%

Solutions

Expert Solution

Auto.java

public class Auto {

private String name;

private String make;

private String model;

private double liability;

private double collision;

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public String getMake() {

return make;

}

public void setMake(String make) {

this.make = make;

}

public String getModel() {

return model;

}

public void setModel(String model) {

this.model = model;

}

public double getLiability() {

return liability;

}

public void setLiability(double liability) {

this.liability = liability;

}

public double getCollision() {

return collision;

}

public void setCollision(double collision) {

this.collision = collision;

}

public Auto(String name,String make,String model,double liability,double collision) {

this.name = name;

this.make = make;

this.model = model;

this.liability = liability;

this.collision = collision;

}

@Override

public String toString() {

return "Auto [name=" + name + ", make=" + make + ", model=" + model

+ ", liability=" + liability + ", collision=" + collision + "]";

}

public double getCommision(){

double commision = (liability + collision)*30 /100;

return commision;

}

}

Home.java

public class Home {

private String name;

private double homesquare;

private double liability;

private double dwelling;

private double content;

public Home(String name,double homesquare,double liability, double dwelling, double content) {

this. name = name;

this. homesquare = homesquare;

this. liability = liability;

this.dwelling = dwelling;

this.content = content;

}

public double getCommision(){

double cs = (liability * 0.3) + ( (dwelling + content) * 0.2 );

return cs;

}

@Override

public String toString() {

return "Home [name=" + name + ", homesquare=" + homesquare

+ ", liability=" + liability + ", dwelling=" + dwelling

+ ", content=" + content + "]";

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public double getHomesquare() {

return homesquare;

}

public void setHomesquare(double homesquare) {

this.homesquare = homesquare;

}

public double getLiability() {

return liability;

}

public void setLiability(double liability) {

this.liability = liability;

}

public double getDwelling() {

return dwelling;

}

public void setDwelling(double dwelling) {

this.dwelling = dwelling;

}

public double getContent() {

return content;

}

public void setContent(double content) {

this.content = content;

}

}

Life.java

public class Life {

private String name;

private int age;

private double term;

public Life(String name,int age, double term) {

this. name = name;

this.age = age;

this.term = term;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public double getTerm() {

return term;

}

public void setTerm(double term) {

this.term = term;

}

@Override

public String toString() {

return "Life [name=" + name + ", age=" + age + ", term=" + term + "]";

}

public int getAge() {

return age;

}

public void setAge(int age) {

this.age = age;

}

public double getCommision(){

double cs = term*0.2;

return cs;

}

}

Policy Test.java

ublic class Policytest {

public static void main(String[] args) {

Auto at = new Auto("shiv","suzuki","A500",0.5,0.6);

Home hm = new Home("shiv",5.5,0.6,0.7,0.8);

Life lf = new Life("shiv",27,5);

System.out.println(at+ "Auto commision"+" "+at.getCommision());

System.out.println(hm+ "Home commision"+" "+hm.getCommision());

System.out.println(lf+ "Life commision"+" "+lf.getCommision());

}

Output

Auto [name=shiv, make=suzuki, model=A500, liability=0.5, collision=0.6]Auto commision 0.33
Home [name=shiv, homesquare=5.5, liability=0.6, dwelling=0.7, content=0.8]Home commision 0.48000000000000004
Life [name=shiv, age=27, term=5.0]Life commision 1.0


Related Solutions

An insurance agent plans to sell three types of policies— homeowner’s insurance, auto insurance and life...
An insurance agent plans to sell three types of policies— homeowner’s insurance, auto insurance and life insurance. The average amount of profit returned per year by each type of insurance policy is as follows: Policy                            Yearly Profit/Policy Homeowner’s               $50 Auto 40 Life 75 Each homeowner’s policy will cost $18.20, each auto policy will cost $14.50 and each life insurance policy will cost $30.50 to sell and maintain. He has projected a budget of $80,000 per year. In addition, the...
An insurance agent plans to sell three types of policies— homeowner’s insurance, auto insurance and life...
An insurance agent plans to sell three types of policies— homeowner’s insurance, auto insurance and life insurance. The average amount of profit returned per year by each type of insurance policy is as follows: Policy/Yearly Profit/Policy Homeowner’s $50 Auto 40 Life 75 Each homeowner’s policy will cost $18.20, each auto policy will cost $14.50 and each life insurance policy will cost $30.50 to sell and maintain. He has projected a budget of $80,000 per year. In addition, the sale of...
An insurance company has the following profitability analysis of its services: Life Insurance Auto Insurance Home...
An insurance company has the following profitability analysis of its services: Life Insurance Auto Insurance Home Insurance Revenues $5,000,000 $10,000,000 $3,000,000 Commissions (1,000,000) (2,000,000) (600,000) Payments (3,000,000) (7,300,000) (2,000,000) Fixed Costs (500,000) (500,000) (500,000) Profit $ 500,000 $ 200,000 ($ 100,000) The fixed costs are distributed equally among the services and are not avoidable if one of the services is dropped. What is the profitability of the remaining services if all services with losses are dropped?
Class for, Management of Marketing Techniques USAA's home and auto insurance policies have ________ attributes because...
Class for, Management of Marketing Techniques USAA's home and auto insurance policies have ________ attributes because the public is not considered to have expert knowledge on them, but knows the desired end state, to have their home or car protected in the event of an emergency. A: credence B: search C: experience D: multiple
How is the Judgement Proof problem mitigated in the auto insurance market? A.Personal auto insurance policies...
How is the Judgement Proof problem mitigated in the auto insurance market? A.Personal auto insurance policies exclude losses occurring when the auto is used for non-personal (business) use B.Purchase of Auto Insurance is mandatory to operate a vehicle C.Insurance companies offer Umbrella Insurance to increase the liability coverage above that offered in Auto Insurance policies D.All states have enacted Financial Responsibility laws
Insurance (explain the different types of insurance coverage you need including health, life, auto, homeowners, etc....
Insurance (explain the different types of insurance coverage you need including health, life, auto, homeowners, etc. With each type of insurance coverage explain how to select the appropriate amount of insurance and the benefits/costs of such coverage) (for the last part of explaining how to select the appropriate amount of insurance and the benefits/costs of such coverage, please explain about Health insurance only )
What is the difference between Whole Life Insurance and Term life Insurance policies?
What is the difference between Whole Life Insurance and Term life Insurance policies?
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.)...
Insurance, Inc. is a large insurance company with partners that specialize in home, auto, and business insurance
Insurance, Inc. is a large insurance company with partners that specialize in home, auto, and business insurance. Since each partner specializes in a different area of insurance, customers would be likely toa) prefer to work with one person who has diverse skills.b) view the service as higher quality than that provided by one person.c) take their business to a sole proprietor, rather than this partnership.d) view the service as lower quality than that provided by one person.e) question the qualifications...
life insurance policyholder may borrow the cash value from their life insurance policies. where are life...
life insurance policyholder may borrow the cash value from their life insurance policies. where are life insurance policy loans shown on life insurance company's financial statements ? A) as an asset. B) as income. C) as an expense. D) as a liability.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT