Advertisement
Guest User

ырцолф

a guest
Oct 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. // ConsoleApplication83.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include <iostream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. class Rabotyaga
  9. {
  10. string name;
  11. int zp;
  12. int god;
  13.  
  14. public:
  15. Rabotyaga(string a = "eidiejdi", int b = 4545, int c = 1991) : name(a), zp(b), god(c)
  16. {}
  17. const int stazh()
  18. {
  19. return 2018 - god;
  20. }
  21. const int dni()
  22. {
  23. return stazh() * 365 + 283;
  24. }
  25. const void print()
  26. {
  27. cout << "name is: " << name << endl;
  28. cout << "zarplata is: " << zp << endl;
  29. cout << "god nacahla rabori is: " << god << endl;
  30. }
  31. ~Rabotyaga() { cout << "CONSTRUCTOR IS DEVOSTATED T_T" << endl; }
  32. };
  33.  
  34.  
  35. int main()
  36. {
  37. string a;
  38. int c, b;
  39. cout << "name, zarplata, god nachala raboti: " << endl;
  40. getline(cin, a);
  41. cin >> b;
  42. cin >> c;
  43. Rabotyaga gus(a, b, c);
  44. cout << "Stazh raboti v polnih godah: " << gus.stazh() << endl;
  45. cout << "Dnei prorabotal (do 10 oktyabrya): " << gus.dni() << endl;
  46. Rabotyaga gus2;
  47. cout << "zapolneno avtomaticheski" << endl;
  48. gus2.print();
  49. cout << "Stazh raboti v polnih godah: " << gus2.stazh() << endl;
  50. cout << "Dnei prorabotal (do 10 oktyabrya): " << gus2.dni() << endl;
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement