Assignment

#include <iostream>
using namespace std;
int main ()
{
int expr;
int age;
string gender;
string status;

cout << "Input your driving experience" <<endl;
cin >> expr;
cout << "Input your age" << endl;
cin >> age;
cout << "Input your gender, M if your a male and F if your a female" <<endl;
cin >> gender;
cout << "Enter your maritial status m-married, d-divorce" <<endl;
cin >> status;
}

int driversGroup (int expr)
{
int expr1=expr;
if (expr1 >= 6)
return 30;
if (expr1 <= 5 && expr >= 3)
return 80;
if (expr1 < 3)
return 150;
}

int ageGroup (int age)
{
int age1=age;
if (age1 >= 61)
return 30;
if (age1 <= 60 && age1 >= 46)
return 20;
if (age1 <= 45 && age1 >= 29)
return 30;
if (age1 <= 28 && age1 >= 18)
return 50;
if (age1 <= 17)


{
cout << "Age not right";
}

{
int isAvailible (string status);
{
string, status-m
if (status-m == "m")
return 0;
}


{
else return 40;
}

int computePremium()
{
int pay= driversGroup(expr) + ageGroup(age)+isAvailible(status1) + 850;
return pay
}
cout << "Person will pay :" << computePremium()<<endl
}


My code doesnot compile right. Please assist me as I am still new to c++
closed account (48T7M4Gy)
Put the code tags top and bottom pls.
closed account (48T7M4Gy)
string, status-m has two errors: no comma and what is status-m? Is that a typo too?
Last edited on
My code doesnot compile right.


Your compiler should at least tell you line numbers of where the issues are.


source.cpp(54): error C2143: syntax error : missing ';' before ','
source.cpp(61): error C2181: illegal else without matching if
source.cpp(65): error C2601: 'computePremium' : local function definitions 
source.cpp(51): this line contains a '{' which has not yet been m
source.cpp(70): error C2143: syntax error : missing ';' before '}'
source.cpp(71): fatal error C1075: end of file found before the left brace 

Topic archived. No new replies allowed.