Make program choose BP and P policy

Write your question here.

[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;
else
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;
}
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
closed account (48T7M4Gy)
Put [/code] at the end of your code block please.
explain please
how can I get this code to read all calculated deductions into Premium due

#include<iostream>
#include<iomanip>
#include<string>

using namespace std;

int main()
{


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


P = 1800;
multi_car = 200.00;

string fname,lname,Policy;


cout << " Enter BP for Basic Premium Policy : " << 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 after $100.00 deductible is : " << P - 100.00 << endl;


else if(age<25)
cout << " No age Reduction Discount. " <<endl;


if(GPA>=3.0)
cout << " Premium Reduction of $200.00 for good GPA is : " << P -200.00 << endl;


else if(GPA<3.0)
cout << "No GPA Reduction . " <<endl;

if (num1>1)
cout << "Multi Car discount with Premuim policy is : " << P - multi_car<< endl;
else if (num1<1)
cout << " There are no Multi Car Discounts for this customer."<<endl;


if (num2>1)
cout << "The increase for each Traffic Volation is 200.00 ." << endl;
if (num2== 1)
cout << " A 200.00 increase is added." << P + 200.00 <<endl;
if (num2 == 2)
cout << " A 400.00 increase is added." << P + 400.00 <<endl;
else if (num2 == 3)
cout << " A 600.00 increase is added." << P + 600.00 <<endl;


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


else if (num2<3)
P= P- multi_car;
cout << " Premium Policy Due is: " << P << endl;







system("Pause");
return 0;
}
Topic archived. No new replies allowed.