Valentines day 2 14 e2getevent cout endl return 0 h31

Info icon This preview shows pages 2–5. Sign up to view the full content.

View Full Document Right Arrow Icon
"Valentine's Day" , 2, 14, 2012, 12, 15); e2.getEvent(); cout << endl; return 0; } H31 Output:
Image of page 2

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

View Full Document Right Arrow Icon
CIS-247C 3/18/2012 OOP/C++ H3 Solutions P a g e | 3 H32 Source code: #include <iostream> #include <iomanip> #include <string> #include <stdlib.h> usingnamespace std; class Employee { private : string firstName; string lastName; char gender; int dependents; double salary; staticint employees; public : // The zero-argument constructor Employee() { firstName = "" ; lastName = "" ; gender = 'N' ; dependents = 0; salary = 50000; employees++; } // The 5-argument constructor Employee(string f, string l, char g, int d, double s) { firstName = f; lastName = l; gender = g; dependents = d; salary = s; employees++; } // setter (also called mutator) functions void setLastName(string name) { lastName = name; } void setFirstName(string name) { firstName = name; } void setGender( char gen) { switch (gen) { case 'f' : case 'F' : case 'M' : case 'm' : gender = gen; break ; default : gender = 'N' ; // 'N' not defined } } void setDependents( int dep) { dependents = dep; } void setSalary( double sal) { salary = sal; } // two overloaded setter functions void setDependents(string dep) {} void setSalary(string salary) {}
Image of page 3
CIS-247C 3/18/2012 OOP/C++ H3 Solutions
Image of page 4

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

View Full Document Right Arrow Icon
Image of page 5
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