Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Rerna
- {
- private:
- enum Stanje {a=0, b, c, d};
- int temperatura;
- public:
- Rerna::Rerna()
- {
- Stanje=a;
- temperatura=0;
- }
- bool Ukljuci()
- {
- if (Stanje=b)
- {
- return false;
- }
- else
- {
- Stanje=b;
- if(temperatura<220)
- temperatura+=20;
- return true;
- }
- }
- bool iskljuci()
- {
- if (Stanje=a)
- {
- return false;
- }
- else
- {
- Stanje=a;
- temperatura=0;
- return true;
- }
- }
- bool Pokvari()
- {
- if (Stanje=c)
- {
- return false;
- }
- else
- {
- Stanje=c;
- temperatura=0;
- return true;
- }
- }
- bool Popravi()
- {
- if (Stanje=d)
- {
- return false;
- }
- else
- {
- Stanje=d;
- temperatura=0;
- return true;
- }
- }
- };
- int main()
- {
- cout << "Hello world!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment