Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "klasy.h"
- #include "funkcje.h"
- // Metody klasy osoba
- // Konstruktor domyślny
- Osoba::Osoba() {
- }
- // Konstruktor z parametrami
- Osoba::Osoba(string &im, string &nazw) {
- imie = im;
- nazwisko = nazw;
- }
- // Konstruktor kopiujący
- Osoba::Osoba(const Osoba &osoba) {
- imie = osoba.imie;
- nazwisko = osoba.nazwisko;
- }
- // Destruktor
- Osoba::~Osoba(){
- }
- // Metody do wyświetlania danych
- void Osoba::wyswietl() {
- cout << right << setw(12) << imie << setw(15) << nazwisko << endl;
- }
- void Osoba::wyswietl_nvirt() {
- cout << right << setw(12) << imie << setw(15) << nazwisko << endl;
- }
- // Metody klasy student
- // Konstruktor domyślny
- Student::Student() {
- }
- // Konstruktor z paramterami
- Student::Student(string &im, string &nazw, float &sred, string &kier, int &nr_sem, int &nr_ind) {
- imie = im;
- nazwisko = nazw;
- srednia = sred;
- kierunek = kier;
- nr_semestru = nr_sem;
- nr_indeksu = nr_ind;
- }
- // Konstruktor kopiujący
- Student::Student(const Student &student) {
- imie = student.imie;
- nazwisko = student.nazwisko;
- srednia = student.srednia;
- kierunek = student.kierunek;
- nr_semestru = student.nr_semestru;
- nr_indeksu = student.nr_indeksu;
- }
- // Destruktor
- Student::~Student(){
- }
- // Funkcje służące do wyświetlania danych w konsoli
- void Student::wyswietl() {
- cout << right << setw(12) << imie << setw(15) << nazwisko << setw(14) << nr_indeksu
- << setw(10) << kierunek << setw(10) << nr_semestru << setw(13) << fixed << setprecision(2) << srednia << "\n";
- }
- // Metody klasy pracownik
- // Konstruktor domyślny
- Pracownik::Pracownik() {
- }
- // Konstruktor z parametrami
- Pracownik::Pracownik(string &im, string &nazw, float &pen) {
- imie = im;
- nazwisko = nazw;
- pensja = pen;
- }
- // Konstruktor kopiujący
- Pracownik::Pracownik(const Pracownik &pracownik) {
- imie = pracownik.imie;
- nazwisko = pracownik.nazwisko;
- pensja = pracownik.pensja;
- }
- // Destruktor
- Pracownik::~Pracownik(){
- }
- // Funkcje do zapisywania i wczytywania danych z/do pliku oraz wyświetlania danych w konsoli
- void Pracownik::wyswietl() {
- cout << right << setw(12) << imie << setw(15) << nazwisko << setw(14) << pensja << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement