//File : CH15pc2.h //Author : Andre Long //Due : November 17, 2004 //Description : This program will demonstrate the concept of inheritance #include #include using namespace std; class Employee { protected: char* EmployeeName; string SSN; string EmpNum; string Hiredate; bool SSNflag; bool EmpNumformatflag; public: Employee() { EmployeeName = new char[9]; strcpy(EmployeeName,"John Doe"); SSN="XXX-XX-XXXX"; EmpNum="XXX-L"; Hiredate="January 1, 2000"; SSNflag=true; EmpNumformatflag=true; } Employee(char* name, string ssn, string emp, string date) { EmployeeName = new char[strlen(name)+1]; strcpy(EmployeeName,name); SSN=ssn; EmpNum=emp; Hiredate=date; ssnFormat();//sets SSNFlag employeeNumberFormat();//sets EmpNumformatflag }//ends constructor void ssnFormat() { SSNflag=true; for(int i=0; i<11; i++) { if(i==3 || i==6) { if(SSN[i]!='-') { SSNflag=false; } } else { if(!isdigit(SSN[i])) { SSNflag=false; } } }//ends for loop }//ends ssnFormat function void employeeNumberFormat() { char A; char M; EmpNumformatflag=true; for(int i=0;i<5; i++) { if(i<3) { if(!isdigit(EmpNum[i])) { EmpNumformatflag=false; } } else if (i==3) { if(EmpNum[i]!='-') { EmpNumformatflag=false; } } else if (i==4) { if( (EmpNum[4]<'A') || (EmpNum[4]>'M') ) { EmpNumformatflag=false; } } }//ends for loop }//ends Employee Number Format function ~Employee() { cout<<"Freeing up memory"<