Srxon05

Pocetak klase rerna cmt

Oct 25th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Rerna
  6. {
  7. private:
  8.     enum Stanje {a=0, b, c, d};
  9.     int temperatura;
  10. public:
  11.     Rerna::Rerna()
  12.     {
  13.         Stanje=a;
  14.         temperatura=0;
  15.     }
  16.  
  17.     bool Ukljuci()
  18.     {
  19.         if (Stanje=b)
  20.         {
  21.             return false;
  22.         }
  23.        
  24.         else
  25.         {
  26.             Stanje=b;
  27.             if(temperatura<220)
  28.                 temperatura+=20;
  29.             return true;
  30.         }
  31.  
  32.  
  33.     }
  34.     bool iskljuci()
  35.     {
  36.         if (Stanje=a)
  37.         {
  38.             return false;
  39.         }
  40.        
  41.         else
  42.         {
  43.             Stanje=a;
  44.                 temperatura=0;
  45.             return true;
  46.         }
  47.  
  48.  
  49.     }
  50.     bool Pokvari()
  51.     {
  52.         if (Stanje=c)
  53.         {
  54.             return false;
  55.         }
  56.        
  57.         else
  58.         {
  59.             Stanje=c;
  60.             temperatura=0;
  61.             return true;
  62.         }
  63.  
  64.  
  65.     }
  66.     bool Popravi()
  67.     {
  68.         if (Stanje=d)
  69.         {
  70.             return false;
  71.         }
  72.        
  73.         else
  74.         {
  75.             Stanje=d;
  76.             temperatura=0;
  77.             return true;
  78.         }
  79.  
  80.  
  81.     }
  82.  
  83. };
  84. int main()
  85. {
  86.     cout << "Hello world!" << endl;
  87.     return 0;
  88. }
Advertisement
Add Comment
Please, Sign In to add comment