35 lines
990 B
C++
35 lines
990 B
C++
#include <iostream>
|
|
#include "Student.h"
|
|
#include "Assistant.h"
|
|
#include "StudentAssistant.h"
|
|
|
|
int main() {
|
|
Student s1("Mark", "FERI", 8.3);
|
|
Assistant a1("Mary", "FKKT", "Introduction to chemistry");
|
|
StudentAssistant sa1("John", "FNM", 10, "FERI", "Discrete math");
|
|
|
|
s1.print();
|
|
a1.print();
|
|
sa1.print();
|
|
/*
|
|
std::cout << "--------------" << std::endl;
|
|
Student* university[2];
|
|
university[0]=&s1;
|
|
university[1]=&sa1;
|
|
//university[1]=&a1; // ERROR: class Assistant is not with any relation with class Student
|
|
for (int i=0; i < 2; i++) {
|
|
university[i]->print();
|
|
std::cout << "Department: " << university[i]->department() << std::endl;
|
|
}
|
|
*/
|
|
/*
|
|
std::cout << "--------------" << std::endl;
|
|
sa1.print();
|
|
//std::cout << "Department: " << sa1.department() << std::endl; // error
|
|
std::cout << "Department Assistant: " << sa1.Assistant::department() << std::endl;
|
|
std::cout << "Department Student: " << sa1.Student::department() << std::endl;
|
|
*/
|
|
return 0;
|
|
}
|
|
|