I am working on creating a program which calculates the amount a company will contribute towards an employees retiremnet plan based on the number of years the employee has worked
for the company....I'm getting two errors at this point don't know where to go from here...here is the code.....the errors point to the two nested if/else if/else .... error C2061: syntax error : identifier 'Employee_Contribution' and 'Years_Worked....
#include <iostream>
using namespace std;
int main()
{
std::cout << "\t\t*********** Retirement\t Calculator **********\n\n";
//Initialize Variables//
char Plan_Type;
int Years_Worked, Salary, Company_Contribution, Employee_Contribution;
//Prompt for user input//
cout << "Enter plan type (S = Standard Plan M = Match Plan). --->\n";
cin >> Plan_Type;
if (Plan_Type == 's' || Plan_Type == 'S')
{
if Years_Worked >= 5 Company_Contribution = 10
else if Years_Worked >= 2 && Years_Worked < 5 Company_Contribution = 5
else Company_Contribution = 0
}
else if (Plan_Type == 'm' || Plan_Type == 'M')
{
if Employee_Contribution >= 6 Company_Contribution = 6
else if Employee_Contribution < 6 Company_Contribution = Employee_Contribution
else Employee_Contribution < 0 Company_Contribution = 0
}
else cout << "INVALID PLAN LETTER\n";
cout << "How many years has the employee worked for this company? --->\n";
cin >> Years_Worked;
cout << "What percentage did the employee contribute? --->\n";
cin >> Employee_Contribution;
cout << "What was the employees last years salary? --->\n";
cin >> Salary;
//Calculation//
if (Plan_Type == 's' || 'S')
Company_Contribution = Salary/Company_Contribution;
else (Plan_Type == 'm' || 'M');
Company_Contribution = Salary/Employee_Contribution;
//Output//
cout << "The total contribution made to the employee byt the company was <<Company_Contribution<<.\n";
return 0;
}