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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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