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

  Function whose job is to input

Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read. A. unsigned readA();

  Determine difference between repeated set of measurements

By this time you are prepared, I trust, to determine that there would be some difference between, two averages. What must we do in such a case?

  Construct a diagram using rationale to map the arguments

An article from the press that cover any of the given topics, for example there have been many articles in the media recently about government surveillance.

  16-bit 2''s complement numbers

Convert the following numbers to 16-bit 2's complement numbers (display results in hexadecimal)

  Confidentiality and integrity for transaction to secure

Make a list of at least 10 confidentiality, integrity, and availability requirements which should be met for transaction to be secure.

  What are the advantages of that method and disadvantages

a company has two building that are 50 meters (roughly 50 yards) apart. Between the building is private land owned by the company. A large walk-through tunnel connects the two buildings.

  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 components of computing environment

According to Raggad's taxonomy of information security, a computing environment is made up of ?ve continuously interacting components namely; activities, people, data, technology and networks.

  Which information in computer critical to personal life

Let the information stored in the personal computer. Do you, at this moment, have information stored in your computer that is critical to your personal life?

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs, Flash RAM, and solid-state drives (SSD)

  Complete a truth table for a 1 bit alu with 5 inputs

Complete a truth table for a 1 bit ALU with 5 inputs (A,B,f0,f1,carry in) and two outputs (Output,C_out)

  Turing machine that decreases positive binary number by one

Write a Turing machine that decreases a positive binary number by one? By writing turing machine an instruction set in the form of (w,x,y,z,a) where w is current state,

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