Class Hierarchy
Main Page
Classes
Files
File List
File Members
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
}
worker.h
salesperson.h
Manager
Definition:
manager.h:10
std
Employee
Definition:
employee.h:9
main
int main()
Definition:
main.cpp:24
SalesPerson
Definition:
salesperson.h:10
manager.h
employee.h
Employee::get_Counter
int get_Counter() const
Definition:
employee.h:39
operator<<
ostream & operator<<(ostream &s, const Employee &org)
Definition:
main.cpp:18
Employee::print
virtual void print(std::ostream &s) const
Definition:
employee.cpp:22
Worker
Definition:
worker.h:10
Generated on Wed May 27 2020 17:17:53 for Class Hierarchy by
1.8.11