Class Hierarchy
main.cpp
Go to the documentation of this file.
1 // Vorlesung: 19.06.2017
2 // Klassenhierarchie:
3 // Employee
4 // Manager Worker
5 // SalesPerson
6 
7 #include "employee.h"
8 #include "manager.h"
9 #include "salesperson.h"
10 #include "worker.h"
11 
12 #include <iostream>
13 using namespace std;
14 
15 
16 ostream& operator<<(ostream &s, const Employee& org); // Deklaration
17 
18 ostream& operator<<(ostream &s, const Employee& org) // Definition
19 {
20  org.print(s);
21  return s;
22 }
23 
24 int main()
25 {
26  cout << "Hello world!" << endl;
27 
28  //Employee aa("Angestellter"); // rein virtuelle Methode payment()
29  // ==> abstrakte Basisklasse Employee
30  // ==> keine Instanz von Employee mehr moeglich
31  Worker bb("Hugo", 160, 15.50);
32  SalesPerson cc("Wanda", 80, 10.2f, 10000, 0.05f);
33  Manager dd("Brenda", 2000);
34  //cout << aa; // nicht mehr moeglich, da Employee abstrakte Basisklasse ist
35  cout << bb;
36  cout << "########## " << dd.get_Counter() <<" ###########\n";
37  cout << cc;
38  cout << "----------------\n" << dd << endl;
39 
40 
41  return 0;
42 }
int main()
Definition: main.cpp:24
int get_Counter() const
Definition: employee.h:39
ostream & operator<<(ostream &s, const Employee &org)
Definition: main.cpp:18
virtual void print(std::ostream &s) const
Definition: employee.cpp:22
Definition: worker.h:10