{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Valentines day 2 14 e2getevent cout endl return 0 h31

Info iconThis 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:
Background 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) {}
Background image of page 3
CIS-247C 3/18/2012 OOP/C++ H3 Solutions
Background 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 ]}