void extEmployeeType::yearsFromRetirement(int age) const
{
if ((age + 65) == age)
cout << "It is " << age << " years after retirement";
else if ((65 - age) == age)
cout << "It is " << age << " years before retirement";
else
extEmployeeType::yearsFromRetirement(age + 1);
}
main.cpp
extEmployeeType age;
cout << "Enter age for the person: ";
cin >> age;
cout << endl;
person1.print();
cout << endl;
extEmployeeType.yearsFromRetirement();
cout << endl;
Add a recursive function yearsFromRetirement() to the employeeType class as a member function. The function will return the number of years either before or after retirement, supposed to be 65, for a given employeeType instance. For example, if an employeeType instance has the age of 25, the function returns a message “It is 40 years before retirement”. If the employeeType instance has the age of 75, the function returns a message “It is 10 years after retirement (or simply -10 years before retirement)”.
I got the member function the age it's supposed to be I believe, but I'm not quite sure how to get the main function to accept the "age"
53 C:\Users\Owner\Desktop\C++ II\Final\Project2\Project_extemployeePersonType_main.cpp no match for 'operator>>' in 'std::cin >> age'
58 C:\Users\Owner\Desktop\C++ II\Final\Project2\Project_extemployeePersonType_main.cpp expected primary-expression before '.' token