Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Lekcja1.h"
- using namespace std;
- class Zadanie {
- public:
- Zadanie(int chose);
- ~Zadanie();
- void Describe();
- private:
- int _chose;
- };
- Zadanie::Zadanie(int chose) {//konstruktor
- this->_chose = chose;
- }
- Zadanie::~Zadanie() {//destruktor
- }
- void Zadanie::Describe() {
- switch (_chose)
- {
- case 1:
- cout << "Huj" << endl;
- break;
- default:
- cout << "Nie ma takiego zadania!" << endl;
- break;
- }
- }
- void wyswietlZadanie(Zadanie* objs) {
- objs->Describe();
- }
- class Lekcja {
- public:
- Lekcja(int chose);
- ~Lekcja();
- void Describe();
- private:
- int _chose;
- int numer;
- };
- Lekcja::Lekcja(int chose) {//konstruktor
- this->_chose = chose;
- }
- Lekcja::~Lekcja() {//destruktor
- }
- void Lekcja::Describe() {
- switch (_chose)
- {
- case 1:
- {
- cout << "Wpisz numer Zadania od 1 do 5: " << endl;
- cin >> numer;
- Zadanie* obj = new Zadanie(numer);
- wyswietlZadanie(obj);
- delete obj;
- }
- break;
- default:
- cout << "Nie ma takiej lekcji!" << endl;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement