Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- enum state {vidsyt, bezpererv, ochik, zaynyat};
- class Phone
- {
- private:
- bool stateline, statephone;
- int volume;
- state stategydok;
- public:
- void pidklofline();
- void vidklofline();
- void upphone();
- void downphone();
- void getVolume();
- void getNumber();
- };
- void Phone::pidklofline()
- {
- stateline = 1;
- if (statephone == 1)
- {
- stategydok = bezpererv;
- }
- }
- void Phone::vidklofline()
- {
- stateline = 0;
- stategydok = vidsyt;
- }
- void Phone::upphone()
- {
- statephone = 1;
- if (stateline = 1) {stategydok = bezpererv;}
- }
- void Phone::downphone()
- {
- statephone = 0;
- stategydok = vidsyt;
- }
- void Phone::getVolume() //Первый getVolume()
- {
- int sila_Zvyka;
- cin>>sila_Zvyka;
- volume = sila_Zvyka;
- }
- void Phone::getNumber() //
- {
- if (stateline == 1 && statephone == 1)
- {
- srand((time(0)));
- bool a = rand()%2;
- if (a)
- stategydok = ochik;
- else
- stategydok = bezpererv;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement