Help please on basic error

cout<<"************************************************************************"<<endl;
cout<<"|\t\t\t The Company Finance Department"<<endl;
cout<<"|Employee Name:"<<empname<<endl;
cout<<"|Department Name:"<<departname<<endl;
cout<<"|Clam Month:"<<claim_month<<endl;
cout<<"|Engine Size Number: ("<<enginesize<<")\t Rate:";
if(enginesize == 1)
{
cout<<"Full Expences Rate"<<endl;
}

else ( enginesize == 2);
{
cout<<"80% Of Full Rate"<<endl;
}

else (enginesize == 3); ERROR HERE (else Statement)
{
cout<<"50% Of Full Rate"<<endl;
}


cout<<"|Monthly Travel Expenses:\t(GBP)"<<totalexp;
cout<<"\n************************************************************************"<<endl;
Hi all,
its better to write your code in ['code'] format in editor, its easier to read.
so, about your error, what will be happen if you replace else (enginesize == 3) with this one else if (enginesize == 3)?
Last edited on
Still the else has a red ridged line under Error: Expected a statement
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
if(enginesize == 1) 
{
cout<<"Full Expences Rate"<<endl;
}
 
else ( enginesize == 2);
 {
cout<<"80% Of Full Rate"<<endl;
 }
 
else if (enginesize == 3);
{
	 cout<<"50% Of Full Rate"<<endl;
}
 
 
 cout<<"|Monthly Travel Expenses:\t(GBP)"<<totalexp; 
 cout<<"\n************************************************************************"<<endl;
On line 6, remove the ; at the end of the line. Same thing on line 11.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
if(enginesize == 1) 
{
cout<<"Full Expences Rate"<<endl;
}
 
else ( enginesize == 2)
 {
cout<<"80% Of Full Rate"<<endl;
 }
 
else if (enginesize == 3)
{
	 cout<<"50% Of Full Rate"<<endl;
}
 
 
 cout<<"|Monthly Travel Expenses:\t(GBP)"<<totalexp; 
 cout<<"\n************************************************************************"<<endl;
Topic archived. No new replies allowed.