Question

In: Computer Science

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

Solutions

Expert Solution

// C++ 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.
#include <iostream>
using namespace std;

int main() {
   int age, accidents;
   double insurance_charge = 500; // base charge
   // input of age
   cout<<"Enter the driver's age : ";
   cin>>age;
   // input of number of accidents
   cout<<"Enter the number of accidents the driver has had : ";
   cin>>accidents;

   // if age < 25, add an additional surface of 100
   if(age < 25)
       insurance_charge += 100;
   // add the accident surcharge based on number of accidents
   if(accidents == 1 || accidents == 2)
       insurance_charge += 25;
   else if(accidents == 3 || accidents == 4)
       insurance_charge += 75;
   else if(accidents == 5)
       insurance_charge += 100;

   // display the total insurance premium
   cout<<"Automobile Insurance premium : $"<<insurance_charge<<endl;

   return 0;
}
//end of program

Output:


Related Solutions

“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of...
“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of 25 automobile insurance policies. This sample has a sample mean annual premium of $1440 and a sample standard deviation of s=$165. a. Construct a 99% confidence interval for the population mean annual automobile insurance premium. b. Assuming everything else is fixed, what happens to the margin of error as the sample size increases.
“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of...
“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of 25 automobile insurance policies. This sample has a sample mean annual premium of $1440 and a sample standard deviation of s=$165. a. Construct a 99% confidence interval for the population mean annual automobile insurance premium. b. Assuming everything else is fixed, what happens to the margin of error as the sample size increases.
“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of...
“In attempting to determine the population mean annual automobile insurance premium, you draw a sample of 25 automobile insurance policies. This sample has a sample mean annual premium of $1440 and a sample standard deviation of s=$165. a. Construct a 99% confidence interval for the population mean annual automobile insurance premium. b. Assuming everything else is fixed, what happens to the margin of error as the sample size increases.
Help with a c Program to compute the car insurance premium for a person based on...
Help with a c Program to compute the car insurance premium for a person based on their age and the number of tickets they have received. The following table explains how to perform the ticket computation: If Person's Age Is Then Insurance Cost Is Less than 21 $1500 + $250 x number of tickets From 21 through 24 $1200 + $250 x number of tickets 25 or older $1000 + $200 x number of tickets Print the person’s age, number...
2. “In attempting to determine the population mean annual automobile insurance premium, you draw a sample...
2. “In attempting to determine the population mean annual automobile insurance premium, you draw a sample of 25 automobile insurance policies. This sample has a sample mean annual premium of $1440 and a sample standard deviation of s=$165. a. Construct a 99% confidence interval for the population mean annual automobile insurance premium. b. Assuming everything else is fixed, what happens to the margin of error as the sample size increases.
The ABC insurance INC. reports that the mean annual premium for automobile insurance in the United...
The ABC insurance INC. reports that the mean annual premium for automobile insurance in the United States was $1608 in summer 2018. However, you believed automobile insurance was cheaper in North Carolina and decided to develop statistical support for your opinion. A sample of 25 automobile insurance policies from the state of North Carolina showed a mean annual premium of $1560 with a standard deviation of s = $165. a. Develop a hypothesis test that can be used to determine...
Automobile Insurance Program: Writes a program that prints the insurance fee to pay for a Vehicle...
Automobile Insurance Program: Writes a program that prints the insurance fee to pay for a Vehicle according to the following rules: A Honda that is All Wheel Drive costs $450. A Honda that is two wheels drive costs $350. A Toyota that is All Wheel Drive costs $300. A Toyota that is Two Wheel Drive costs $250. A Nissan that is All Wheel Drive costs $200. A Nissan that is Two Wheel Drive costs $280.
Automobile Insurance Program: Writes a program that prints the insurance fee to pay for aVehicle...
Automobile Insurance Program:Writes a program that prints the insurance fee to pay for a Vehicle according to the following rules:A Honda that is All Wheel Drive costs $450.A Honda that is two wheels drive costs $350.A Toyota that is All Wheel Drive costs $300.A Toyota that is Two Wheel Drive costs $250.A Nissan that is All Wheel Drive costs $200.A Nissan that is Two Wheel Drive costs $280.
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...
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.)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT