Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. enum state {vidsyt, bezpererv, ochik, zaynyat};
  8.  
  9. class Phone
  10. {
  11. private:
  12. bool stateline, statephone;
  13. int volume;
  14. state stategydok;
  15. public:
  16. void pidklofline();
  17. void vidklofline();
  18. void upphone();
  19. void downphone();
  20. void getVolume();
  21. void getNumber();
  22. };
  23.  
  24. void Phone::pidklofline()
  25. {
  26. stateline = 1;
  27. if (statephone == 1)
  28. {
  29. stategydok = bezpererv;
  30. }
  31. }
  32.  
  33. void Phone::vidklofline()
  34. {
  35. stateline = 0;
  36. stategydok = vidsyt;
  37. }
  38.  
  39. void Phone::upphone()
  40. {
  41. statephone = 1;
  42. if (stateline = 1) {stategydok = bezpererv;}
  43. }
  44.  
  45. void Phone::downphone()
  46. {
  47. statephone = 0;
  48. stategydok = vidsyt;
  49. }
  50.  
  51. void Phone::getVolume() //Первый getVolume()
  52. {
  53. int sila_Zvyka;
  54. cin>>sila_Zvyka;
  55. volume = sila_Zvyka;
  56. }
  57.  
  58. void Phone::getNumber() //
  59. {
  60. if (stateline == 1 && statephone == 1)
  61. {
  62. srand((time(0)));
  63. bool a = rand()%2;
  64. if (a)
  65. stategydok = ochik;
  66. else
  67. stategydok = bezpererv;
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement