From 17845570ef6da4165839b22bb30ee50a25bb5e36 Mon Sep 17 00:00:00 2001 From: Frank Filthaut Date: Tue, 10 Dec 2019 09:14:11 +0100 Subject: [PATCH] add input for ex8.1 --- ex8.1/Employee.hh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ex8.1/Employee.hh 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