diff --git a/ex8.1/Employee.hh b/ex8.1/Employee.hh new file mode 100644 index 0000000..371daa2 --- /dev/null +++ b/ex8.1/Employee.hh @@ -0,0 +1,33 @@ +#ifndef EMPLOYEE_HH +#define EMPLOYEE_HH + +#include +#include +using namespace std ; + +class Employee { + +public: + // Constructor + Employee(const char* name, double salary) : _name(name), _salary(salary) {} + + // Accessors + const char* name() const { return _name.c_str() ; } + double salary() const { return _salary ; } + + // Print functions + void businessCard(ostream& os = cout) const { + os << " +------------------+ " << endl + << " | ACME Corporation | " << endl + << " +------------------+ " << endl + << " " << name() << endl ; + } + +private: + + string _name ; + double _salary ; + +} ; + +#endif