32 lines
741 B
C++
32 lines
741 B
C++
#include <iostream>
|
|
#include "Person.h"
|
|
#include "Student.h"
|
|
#include "Assistant.h"
|
|
#include "StudentAssistant.h"
|
|
|
|
int main() {
|
|
Person o1("Anna");
|
|
Student s1("Mark", "FERI", 8.3);
|
|
Assistant a1("Mary", "FKKT", "Introduction to chemistry");
|
|
StudentAssistant sa1("John", "FNM", 10, "FERI", "Discrete math");
|
|
|
|
o1.print();
|
|
s1.print();
|
|
a1.print();
|
|
sa1.print();
|
|
/*
|
|
std::cout << "--------------" << std::endl;
|
|
Person* society[4];
|
|
society[0]=&o1;
|
|
society[1]=&s1;
|
|
society[2]=&a1;
|
|
//society[3]=&a1;
|
|
society[3]=&sa1; //without virtual derivation class StudentAssistant can not be converted to class Person
|
|
for (int i=0; i < 4; i++) {
|
|
society[i]->print();
|
|
}
|
|
*/
|
|
return 0;
|
|
}
|
|
|