Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Header.h"
- class Payment
- {
- private:
- char* fio;
- double oklad;
- double nalog;
- int rab_day_month;
- int day_month;
- double nach_summ;
- double yder_summ;
- double zp;
- public:
- Payment(): oklad(0), rab_day_month(0), nalog(0.14), day_month(30), nach_summ(0), yder_summ(0){//Default Constructor
- fio = new char[30];
- strcpy( fio, "Nobody" );
- cout << "Default Constructor is working." << endl;
- }
- Payment( char* _fio, double _oklad, int _rab_day_month): nalog(0.14), rab_day_month(20) {//Parametrized Constructor
- cout << "Parametrized Constructor is working." << endl;
- fio = new char[strlen(_fio)+1];
- strcpy(fio, _fio);
- oklad = _oklad;
- rab_day_month = _rab_day_month;
- nach_summ = vichisl_nach_summ();
- yder_summ = vichisl_yder_summ();
- }
- Payment(const Payment& obj){//Copy Constructor
- cout << "Copy Constructor is working." << endl;
- fio = new char [strlen(obj.fio)+1];
- strcpy(fio, obj.fio);
- oklad = obj.oklad;
- rab_day_month = obj.rab_day_month;
- day_month = obj.day_month;
- yder_summ = obj.yder_summ;
- }
- ~Payment(){
- delete[] fio;
- cout << "Destructor is working." << endl;
- }
- double vichisl_nach_summ();
- double vichisl_yder_summ();
- double vichisl_zp();
- void set();
- void show();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement