Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef KLASY_H
- #define KLASY_H
- #include <cstdlib>
- #include <iostream>
- #include <string>
- #include <ctype.h>
- #include <conio.h>
- #include <iomanip>
- #include <limits>
- using namespace std;
- class Osoba {
- protected:
- string imie;
- string nazwisko;
- public:
- // Konstruktor domyślny
- Osoba();
- // Konstruktor z parametrami
- Osoba(string &imie, string &nazwisko);
- // Konstruktor kopiujący
- Osoba(const Osoba &osoba);
- // Destruktor
- virtual ~Osoba();
- //Funkcje do zapisywania i wczytywania danych z/do pliku oraz wyświetlania danych w konsoli
- virtual void wyswietl();
- void wyswietl_nvirt();
- // Przeciążony operator przypisania
- void operator =(const Osoba & osoba) {
- imie = osoba.imie;
- nazwisko = osoba.nazwisko;
- }
- };
- class Student : public Osoba {
- protected:
- float srednia;
- string kierunek;
- int nr_semestru;
- int nr_indeksu;
- public:
- // Konstruktor domyślny
- Student();
- // Konstruktor z parametrami
- Student(string &imie, string &nazwisko, float &srednia, string &kierunek, int &nr_semestru, int &nr_indeksu);
- // Konstruktor kopiujący
- Student(const Student &student);
- // Destruktor
- ~Student();
- // Funkcje do wyświetlania danych w konsoli
- void wyswietl();
- // Przeciążony operator przypisania
- void operator =(const Student & student) {
- Osoba::operator=(student);
- imie = student.imie;
- nazwisko = student.nazwisko;
- srednia = student.srednia;
- kierunek = student.kierunek;
- nr_semestru = student.nr_semestru;
- nr_indeksu = student.nr_indeksu;
- }
- };
- class Pracownik : public Osoba {
- protected:
- float pensja;
- public:
- // Konstruktor domyślny
- Pracownik();
- // Konstruktor z parametrami
- Pracownik(string &imie, string &nazwisko, float &pensja);
- // Konstruktor kopiujący
- Pracownik(const Pracownik &pracownik);
- // Destruktor
- ~Pracownik();
- // Funkcje do wyświetlania danych w konsoli
- void wyswietl();
- // Przeciążony operator przypisania
- void operator =( const Pracownik & pracownik ){
- Osoba::operator=(pracownik);
- pensja=pracownik.pensja;
- }
- };
- #endif /* KLASY_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement