Car Insurance Code issue

I'm Trying to get the program to recognize the difference between Basic premium and Premium. I don't know if my If else statements are correct or am I missing something?

[code]
include<iostream>
#include<iomanip>
#include<string>

using namespace std;

int main()
{


double age,GPA,num1,num2,multi_car ;
double BP,P; // BP= Basic premium // P= Premium

BP = 1800;
P = 2800;
multi_car = 200.00;

string fname,lname,policy;

cout <<" Please enter BP for Basic policy or P for Premium : " << endl;
cin >> policy;

cout << " Please Enter Driver First Name and Last Name: " << endl;
cin >> fname >> lname;

cout << "Please Enter Drivers Age: " << endl;
cin >> age;

cout << "Enter Drivers GPA : " << endl;
cin >> GPA;

cout << "Enter the number of cars insured : " << endl;
cin >> num1;

cout << "Please enter the number of Driving Volations : " << endl;
cin >> num2;

cout << fixed << showpoint << setprecision(2);

if (age>25)
cout << "Premium Age Reduction: " << P - 100.00 << endl;

else
cout << "Basic Premium age Reduction: " << BP - 100.00 << endl;

if(age<25)
cout << "You have no age reduction. " <<endl;


if(GPA>=3.0)
cout << "Basic Premium reduction for good GPA is : " << BP -200.00 << endl;


if(GPA<3.0)
cout << "You have no GPA reduction at this time. " <<endl;

if (num1>1)
cout << "Multi Car discount with Premuim policy is : " << P - multi_car<< endl;
cout << "Multi Car discount with Basic Premuim is : " << BP- multi_car<< endl;




if (num1<1)
cout << " There are no Multi Car Discounts for this customer."<<endl;


if (num2>3)
cout << " This Policy is cancelled "<< " "<< "Please call customer service. " << endl;

else if (num2<3 && num1<1)
cout << "Basic Policy Premium Due is: " << BP- multi_car<< endl;
if (num2<3 && num1>1)
cout << " Premium Policy Due is: " << P- multi_car<< endl;





system("Pause");
return 0;
}
You ask the user for a the policy type,
1
2
cout << " Please enter BP for Basic policy or P for Premium : " << endl;
	cin >> policy;

but then never use it.
Last edited on
Please enter BP for Basic policy or P for Premium :
Please Enter Driver First Name and Last Name:
Tim Moore
Please Enter Drivers Age:
20
Enter Drivers GPA :
0
Enter the number of cars insured :
5
Please enter the number of Driving Volations :
0
Basic Premium age Reduction: 1700.00
You have no age reduction.
You have no GPA reduction at this time.
Multi Car discount with Premuim policy is : 2600.00
Multi Car discount with Basic Premuim is : 1600.00
Premium Policy Due is: 2600.00
Press any key to continue . . .

The program doesn't know if your choosing a P or BP policy.

Do you know how I can get it to recognize the difference between the two? The Program should show at the end if the person picked premuim or basic policy

Here is what happens when I use the line:
Please enter BP for Basic policy or P for Premium :
BP
Please Enter Driver First Name and Last Name:
Tim Moore
Please Enter Drivers Age:
25
Enter Drivers GPA :
0
Enter the number of cars insured :
5
Please enter the number of Driving Volations :
0
Basic Premium age Reduction: 1700.00
You have no GPA reduction at this time.
Multi Car discount with Premuim policy is : 2600.00
Premium Policy Due is: 2600.00
Press any key to continue . . .

please help me ..
Last edited on
Topic archived. No new replies allowed.