Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class worker{
- string name;
- int age;
- public:
- void set_worker(string name, int age){
- this->name = name;
- this->age = age;
- }
- void info_worker(){
- cout << "Имя работник: " << name << endl;
- cout << "Возраст работника: " << age << endl;
- }
- };
- class agronom: public worker{
- int exp;
- string type_product;
- public:
- void set_agronom(int exp, string type_product){
- this->exp = exp;
- this->type_product = type_product;
- }
- void info_agronom(){
- cout << "Стаж работы: " << exp << endl;
- cout << "Агроном работает с: " << type_product << endl;
- }
- };
- class firm{
- string name_firm;
- int capital;
- string name_founder;
- public:
- void set_firm(string name_firm, string name_founder, int capital){
- this->name_firm = name_firm;
- this->name_founder = name_founder;
- this->capital = capital;
- }
- void info_firm(){
- cout << "Название фирмы: " << name_firm << endl;
- cout << "Учредитель: " << name_founder << endl;
- cout << "Уставной капитал: " << capital << endl;
- }
- };
- class worker_agro_firm: public firm{
- int money;
- int quanity_worker_day;
- public:
- void set_agro(int money, int quanity_worker_day){
- this->money = money;
- this->quanity_worker_day = quanity_worker_day;
- }
- void info_agro(){
- cout << "Зарплата: " << money << endl;
- cout << "Количество рабочих дней: " << quanity_worker_day << endl;
- }
- };
- class director_agro_firm: public firm{
- int money, holiday;
- public:
- void set_director(int money, int holiday){
- this->money = money;
- this->holiday = holiday;
- }
- void info_director(){
- cout << "Зарплата директора: " << money << endl;
- cout << "Количество отпусков: " << holiday << endl;
- }
- };
- class agro_worker_agrcult: public firm{
- int money;
- string type_agro_cult;
- public:
- void set_agr(int money, string type_agro_cult){
- this->money = money;
- this->type_agro_cult = type_agro_cult;
- }
- void info_agr(){
- cout << "Зарплата работника агронома фермерского хозяйства: " << money << endl;
- cout << "Работник агроном занимается: " << type_agro_cult << endl;
- }
- };
- using namespace std;
- int main(){
- agronom aa;
- aa.set_worker("Malek", 35);
- aa.info_worker();
- aa.set_agronom(15, "rye");
- aa.info_agronom();
- worker_agro_firm a;
- agro_worker_agrcult b;
- director_agro_firm c;
- a.set_firm("NLMK", "Johm", 10000);
- a.info_firm();
- a.set_agro(30000, 20);
- a.info_agro();
- a.info_firm();
- c.set_director(90000, 3);
- c.info_director();
- a.info_firm();
- b.set_agr(65000, "wheat");
- b.info_agr();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement