setAnnualSalary string pay annualSalary atof pay cstr int Employee numEmployees

Setannualsalary string pay annualsalary atof pay cstr

This preview shows page 3 - 4 out of 4 pages.

::setAnnualSalary( string pay ) { annualSalary = atof( pay .c_str()); } int Employee ::numEmployees = 0; int Employee ::getNumEmployees() //static method { return numEmployees; }; void DisplayIntroduction(); void DisplayDivider( string ); string GetInput( string ); void TerminateApplication(); int main() { //Intro message DisplayIntroduction(); //Declare variables string input = " " ; //Employee # 1 Info Employee employeeOne; DisplayDivider( "Employee 1" ); cout << endl; input = GetInput( "First Name" ); employeeOne.setFirstName(input); input = GetInput( "Last Name" );
Image of page 3
employeeOne.setLastName(input); input = GetInput( "Gender" ); employeeOne.setGender(input.at(0)); input = GetInput( "Dependent" ); employeeOne.setDependent(input); input = GetInput( "Annual Salary" ); employeeOne.setAnnualSalary(input); cout << endl; //Display Employee # 1 Info employeeOne.DisplayEmployee(); employeeOne.DisplayEmployeeNum(); cout << endl; //Employee # 2 Info DisplayDivider( "Employee 2" ); cout << endl; Employee employeeTwo( "John" , "Doe" , 'M' , 2, 63000); //Display Employee # 2 Info employeeTwo.DisplayEmployee(); employeeTwo.DisplayEmployeeNum(); cout << endl; TerminateApplication(); return 0; } void DisplayIntroduction() { cout << "Welcome to the Employee Class Prgoram" << endl; cout << "CIS247, Week 3 Lab" << endl; cout << "Name: Name" << endl; cout << endl; } void DisplayDivider( string outputTitle ) { cout << "********************** " << outputTitle << " ******************" << endl; } string GetInput( string input ) { cout << "Please enter your " << input << " : " ; getline(cin, input ); return input ; } void TerminateApplication() { cout << "Press any key to continue..." ; cin.ignore(); cin.get(); }
Image of page 4

You've reached the end of your free preview.

Want to read all 4 pages?

  • Winter '16
  • Personal name, Family name, Given name, char getGender, void Employee

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes