For hypothetical insurance company

Assignment Help Basic Computer Science
Reference no: EM13166377

 for hypothetical insurance company. This company offers insurance for 4 types of vehicles: cars, trucks, motor cycles and boats. In order to keep the program manageable, we will assume that we do not make a finer distinction among various types that can be found among each type of vehicle. For example, we do not care if it is a small car, or a big car. Your program is required to calculate the applicable insurance premium for a potential customer given the number of vehicles insured. This customer may want insurances for one or more vehicle; you do not know ahead of time the number of vehicles.   Since you have no means of storing the result, you will be printing out the insurance value for each vehicle before proceeding with the calculation for the next vehicle. Once all vehicle insurances are calculated and printed, you will print a summary showing the number of vehicles insured for that person and the total premium due from the customer. You are free to choose other output lines to make the output user friendly.

1.      The base premiums are:

               Passenger car: $297

               Light Truck: $350

               Motor Cycle: $500

               Boat: $297

               These could be treated as Constants for this program.

 

2.      Multi-vehicle discount: This depends on the accident history.

Accident history:

  • At most one accident in 5 years: No additional charge
    • Multi-vehicle discount allowed using the following rules:

§ 1 vehicle: No discount

§ 2 or 3: 15% discount on the total premium

§ More than 3: 18% discount on the total premium

  • Two to three accidents in 5 years: 20% add on for each vehicle
    • Multi-vehicle discount allowed using the following rules:

§ 1 vehicle: No discount

§ 2 or 3: 7% discount on the total premium (base + accident markup)for that customer

§ More than 3: 10% discount on the total premium (base + accident markup)

  • Four to five accidents in five years: 30% add on for each vehicle; no multi vehicle discount allowed
  • More than 5 accidents in five years: No insurance given to the individual

 

3.      DUI History: If there is a DUI conviction, the final premium is increased by 7%. The final premium before DUI mark up is calculated as Base Premium + Accident Mark up if any - Multi car discount.

 

The customer may want one or more vehicles per each type. Here is a sample run:

 

               Enter number of accidents in last 5 years: 2

               DUI Conviction: yes

               Vehicle :   car

               Next Vehicle: car

               Next Vehicle: Boat

 

               Output

                              Number of vehicles insured: 3

                              Vehicle types: car, car, boat

                              Base premium: $891.00

                              Accident add-on: $178.20

                              Multicar discount: $74.84

                              DUI Mark Up: $69.60

                              Total Premium: $1063.96

 

 

Calculation explanations to help in the program:

               Number of vehicles insured: Count of vehicles

               Vehicle types: self-explanatory

               Base premium: sum of applicable base premiums, in this case car+car+boat

               Accident add-on: 2 accidents, hence 20% add on per vehicle

               Multicar discount: 3 vehicles, hence 7% discount on premium (891+178.20)*0.07

               DUI Mark Up: 7% on total premium (891+178.2-74.87)*.07

               Total Premium: Base + Accident markup - Multicar discount + DUI markup

 

Name of the Program Class: Insurance.java

 

 

This is what I got so far :

 

import java.util.Scanner;

 

 

public class Insurance {

public static void main (String [] args) {

 

int Passenger_Car = 297;

int Light_Truck = 350;

int Motor_Cycle = 500;

int Boat = 297;

double total_base_premuim = 0.0;

double total_accident = 0.0;

double total_discount = 0.0;

double DUI = 0.0;

double total_InsuranceCost = 0.0;

String all_vehicles = "";

 

Scanner input = new Scanner (System.in);

System.out.println("Enter the number of Vehicles");

int Numbvehicles = input.nextInt();

System.out.println("Enter the number of Accidents");

int Numb_of_Accidents = input.nextInt();

System.out.println("Have you been convicted in DUI");

boolean DUI = input.nextBoolean();

 

for (int i=0; i < Numbvehicles; i++;) {

double totalBasePremuim = 0.0;

double totalAccident = 0.0;

double totalDiscount = 0.0;

double localDUI = 0.0;

double totalInsurance_Cost = 0.0;

 

System.out.println("What is the car type?");

String CarType = input.nextLine();

 

if (CarType.equalsIgnoreCase("passenger car")) {

totalBasePremuim = Passenger_Car;

total_base_premuim += totalBasePremuim;

 

 

} else if (CarType.equalsIgnoreCase("light truck")) {

} else if (CarType.equalsIgnoreCase("Motor Cycle")) {

} else if (CarType.equalsIgnoreCase("Boat")){

}

 

}

 

   }

 

 

Reference no: EM13166377

Questions Cloud

Calculate the mole fraction of ethylene glycol in solution : Calculate the mole fraction of ethylene glycol in the solution.
Compute the price and efficiency variances of new fashions : Describe the types of actions the employees at New Fashions may have taken to reduce the accuracy of the standards set by the independent consultant. Why would employees take those actions? Is this behavior ethical?
State a solution consisting of methylbenzene : A solution consisting of .200 mol of methylbenzene (C6H5CH3) in 250 g of nitrobenzene (C6H5NO2)freezes at .40 degrees celsius
Piaget’s stages of development-cognitive development : What are the stages associated with Piaget’s stages of development? Which stage do you feel is most critical in the cognitive development of an individual? Why? 200--300 words cite references
For hypothetical insurance company : for hypothetical insurance company. This company offers insurance for 4 types of vehicles: cars, trucks, motor cycles and boats.
Time discussing national politics : Now that we have spent some time discussing national politics, let's move to the international level. Specifically, let's think about an organization like the European Union (EU). Why was it formed?
Calculate the molar concentration of radon in the water : A sample consisting of various gases contains 3.4 10-6 mole fraction of radon. This gas at a total pressure of 33 atm is shaken with water at 30°C. Calculate the molar concentration of radon in the water.
Write a program that will define the f string manipulation : 1.) Write a program that will define the following string manipulation functions. Each is analogous to thecorresponding C++ string function.
Analyzing activity in inventory accounts : Analyzing Activity in Inventory Accounts and select data concerning operations of Cascade Manufacturing Company for the past fiscal year follow:

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Find out amount of access that new user needs

As a security manager for XYZ Corporation, you are asked to find out amount of access that new user needs. You contact user and ask them to help you understand what kind of access they need.

  Function drawlinegraph that generates a line graph

Write a function DrawLineGraph that generates a line graph given an array of x-coordinate values, a second array of corresponding y-coordinate values, and the number of data points.

  Explaining quasi-legal activities over internet

Online gambling and buying of pharmaceutical drugs over the Internet are quasi-legal activities which can only take place as Internet allows the parties offering gambling.

  Create confidence interval for proportion of all welders

Create the 95 percent confidence interval for proportion of all welders who graduated from registered welding course.

  Encourage cooperation consistent with standards

Encourage cooperation from all, make it suitable to clean up, be consistent with standards - Who will put it away? Explain where will it be put away? When will it be put away?

  Explaining models in system analysis and design

In System Analysis and Design: Models are widely used in wide variety of technical occupations beyond information technology.

  Explain make-buy decision for management prerogative

Make-buy decision is the significant management prerogative. You are manager of software organization which has average software development cost of $20.00/LOC.

  Explain customer relationship management system

Describe what do you mean by a "customer relationship management system". Write and explain several categories of CRM systems.

  Create 4 order class fields

Create 4 Order class fields: order number, customer name, quantity ordered, and total price. Create public accessors for each field except total price.

  Analyze the consequences of experiment done on mice

Group that had been fed had retained this ability, but other group had not. Probable reason that scientists used only mice from same pure-bred strain is so that?

  Following class definition

Given the following class definition, describe the type of variables used by the arguments and return values of the following member functions (values, pointers, or references):

  The uml class

The UML Class, Sequence Diagrams etc, can be drawn in preferably NetBeans UML, if it is not convenient on that, any other UML tool would do

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd