Please help. The two error messages are 1. base class 'Employee' has incomplete type and 2. Parse error at end of input. below is the code. Must enter the info and then it prints out what you entered using a base class and a derived class.
Please help with other parts if you see any miss direction and send me in the right direction.
Thanks so much.
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <iomanip.h>
class Employee
{
protected:
char EmployeeName;
char SSNum[12];
char EmpNum[6];
int HireDate;
public:
Employee(void) { EmployeeName = new name[25]; }
~Employee(void) { delete [] EmployeeName;}
void setName(char n)
{ strcpy(name, n); }
void setSSNum(char i)
{ strcpy(SSNum, i); }
void setEmpNum(char e)
{ strcpy(EmpNum, e); }
void setHireDate(int h) { HireDate = h; }
float getName(void) { return name[]; }
float getSSNum(void) { return SSNum[]; }
float getEmpNum(void) { return EmpNum[]; }
int getHireDate(void) { return HireDate
};
class EmployeePay : public Employee
{
private:
float AnnualPay;
float MonthlyPay;
int Dependents;
public:
EmployeePay(float, float, int);
void setAnnualPay(float p) { AnnualPay = p; }
void setMonthlyPay(float m) { MonthlyPay = m; }
int setDependents(int d) { Dependents = d; }
float getAnnualPay(void) { return AnnualPay; }
float getMonthlyPay(void) { return MonthlyPay; }
int getDependents(void) { return Dependents; }
};
//EmployeePay::EmployeePay(float AnnualPay, float MonthlyPay, int Dependents) : Employee(name, SSNum, EmpNum, HireDate)
//{
//}
void main(void)
{
Employee PerInfo;
EmployeePay PayInfo;
cout << "Enter the Name: ";
cin >> name;
cout "Enter Social Security Number ( in the format xxx-xx-xxxx, where x is a number); "
cin >> SSNum;
cout << "Enter Employee Number (in the format XXX-l, where x is a number";
cout << " \t and L is a letter between A-M): "
cin >> EmpNum;
cout << "Enter Hire date: ";
cin >> HireDate;
cout << "Enter annual pay: ";
cin >> AnnualPay;
cout << "Enter monthly pay: ";
cin >> MonthlyPay;
cout << "Enter number of dependencies: ";
cin >> Dependents;
cout << endl;
cin.getline(name, 25);
PerInfo.setName(name);
cin.getline(SSNum, 12);
PerInfo.setSSNum(SSNum);
PerInfo.setEmpNum(EmpNum);
cin.getline(HireDate, 9);
PerInfo.setHireDate(HireDate);
PayInfo.setAnnualPay(AnnualPay);
PayInfo.setMonthlyPay(MonthlyPay);
PayInfo.setDependents(Dependents);
cout << "Name: " << PerInfo.getName();
cout << "Social Security Number: " << PerInfo.getSSNum();
cout << "Employee #: " << PerInfo.getEmpNum();
cout << "Hire Date: " << PerInfo.getHireDate();
cout << "Annual Pay: " << PayInfo.getAnnualPay();
cout << "Monthly Pay: " << PayInfo.getMonthlyPay();
cout << "# of Dependents: " << PayInfo.getMonthlyPay();
coun << endl;
system("PAUSE");
}