Mystring void cout nthe end of the cis247c week4

Info icon This 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
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:
Image of page 7
CIS-247C Homework H4 solutions 3/27/2012
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern