aboutsummaryrefslogtreecommitdiff
path: root/inheritance/polymorphism/employee.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'inheritance/polymorphism/employee.cxx')
-rw-r--r--inheritance/polymorphism/employee.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/inheritance/polymorphism/employee.cxx b/inheritance/polymorphism/employee.cxx
new file mode 100644
index 0000000..83a51e6
--- /dev/null
+++ b/inheritance/polymorphism/employee.cxx
@@ -0,0 +1,27 @@
+// file : inheritance/polymorphism/employee.cxx
+// copyright : not copyrighted - public domain
+
+#include <iostream>
+
+#include "employee.hxx"
+
+using namespace std;
+
+person::
+~person ()
+{
+}
+
+void employee::
+print ()
+{
+ cout << first_ << ' ' << last_
+ << (temporary_ ? " temporary " : " permanent ")
+ << "employee" << endl;
+}
+
+void contractor::
+print ()
+{
+ cout << first_ << ' ' << last_ << ' ' << email_ << " contractor" << endl;
+}