{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Mystring void cout nthe end of the cis247c week4

Info iconThis preview shows pages 6–8. Sign up to view the full content.

View Full Document Right Arrow Icon
mystring; } void TerminateApplication() { cout<< "\nThe end of the CIS247C Week4 iLab.\n" ;} int main() { //create two employee objects Employee employee1; //declare and instantiate the object variable char gender; double lifeInsurance; int vacation; string str; //always provide some type of application information to
Background image of page 6

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CIS-247C Homework H4 solutions 3/27/2012 the user--don't leave them cold! DisplayApplicationInformation(); //use a utility method to keep a consistent format to the output DisplayDivider( "Employee 1" ); //access the employee objects members using the DOT notation employee1.setFirstName(GetInput( "First Name " )); employee1.setLastName(GetInput( "Last Name " )); str = GetInput( "Gender " ); gender = str.at(0); employee1.setGender(gender); employee1.setKids(atoi( GetInput( "Dependents " ).c_str())); employee1.setSalary(atof(GetInput( "Annual Salary " ).c_str())); Benefit theBenefits; //set the benefit information theBenefits.setHealInsure(GetInput( "Health Insurance" )); theBenefits.setLifeInsure(atof(GetInput( "Life Insuarance" ).c_str())); theBenefits.setVacDays(atoi(GetInput( "Vocation Days" ).c_str())); //set the benefit information employee1.setBenefits(theBenefits); //now show all the information, including the benefit information employee1.getEmployee(); //use the Class level static method to display the number of employees cout<< "--- Number of Employee Object Created ----" ; cout<< "\nNumber of employees: " << Employee::getEmployees(); DisplayDivider( "Employee 2" ); //create a benefit object directly Benefit myBenefits( "North West Mutual" , 5000000, 14); //create a second employee object this time use the default constructor Employee employee2( "Mary" , "Noia" , 'F' , 2, 150000, "North West Mutual" , 5000000, 14); employee2.getEmployee(); cout<< "\n--- Number of Employee Object Created ----" ; cout<< "\nNumber of employees: " <<Employee::getEmployees(); TerminateApplication(); } H42 – Output:
Background image of page 7
CIS-247C Homework H4 solutions 3/27/2012
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}