Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication83.cpp : Defines the entry point for the console application.
- //
- #include <iostream>
- #include <string>
- using namespace std;
- class Rabotyaga
- {
- string name;
- int zp;
- int god;
- public:
- Rabotyaga(string a = "eidiejdi", int b = 4545, int c = 1991) : name(a), zp(b), god(c)
- {}
- const int stazh()
- {
- return 2018 - god;
- }
- const int dni()
- {
- return stazh() * 365 + 283;
- }
- const void print()
- {
- cout << "name is: " << name << endl;
- cout << "zarplata is: " << zp << endl;
- cout << "god nacahla rabori is: " << god << endl;
- }
- ~Rabotyaga() { cout << "CONSTRUCTOR IS DEVOSTATED T_T" << endl; }
- };
- int main()
- {
- string a;
- int c, b;
- cout << "name, zarplata, god nachala raboti: " << endl;
- getline(cin, a);
- cin >> b;
- cin >> c;
- Rabotyaga gus(a, b, c);
- cout << "Stazh raboti v polnih godah: " << gus.stazh() << endl;
- cout << "Dnei prorabotal (do 10 oktyabrya): " << gus.dni() << endl;
- Rabotyaga gus2;
- cout << "zapolneno avtomaticheski" << endl;
- gus2.print();
- cout << "Stazh raboti v polnih godah: " << gus2.stazh() << endl;
- cout << "Dnei prorabotal (do 10 oktyabrya): " << gus2.dni() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement