mashlukashova

Untitled

May 20th, 2019
123
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Header.h"
  2. class Payment
  3. {
  4. private:
  5. char* fio;
  6. double oklad;
  7. double nalog;
  8. int rab_day_month;
  9. int day_month;
  10. double nach_summ;
  11. double yder_summ;
  12. double zp;
  13. public:
  14.  
  15.  
  16. Payment(): oklad(0), rab_day_month(0), nalog(0.14), day_month(30), nach_summ(0), yder_summ(0){//Default Constructor
  17.  
  18. fio = new char[30];
  19. strcpy( fio, "Nobody" );
  20. cout << "Default Constructor is working." << endl;
  21. }
  22.  
  23.  
  24. Payment( char* _fio, double _oklad, int _rab_day_month): nalog(0.14), rab_day_month(20) {//Parametrized Constructor
  25.  
  26. cout << "Parametrized Constructor is working." << endl;
  27. fio = new char[strlen(_fio)+1];
  28.  
  29. strcpy(fio, _fio);
  30.  
  31. oklad = _oklad;
  32. rab_day_month = _rab_day_month;
  33. nach_summ = vichisl_nach_summ();
  34. yder_summ = vichisl_yder_summ();
  35. }
  36.  
  37.  
  38. Payment(const Payment& obj){//Copy Constructor
  39. cout << "Copy Constructor is working." << endl;
  40. fio = new char [strlen(obj.fio)+1];
  41. strcpy(fio, obj.fio);
  42. oklad = obj.oklad;
  43. rab_day_month = obj.rab_day_month;
  44. day_month = obj.day_month;
  45. yder_summ = obj.yder_summ;
  46. }
  47.  
  48. ~Payment(){
  49. delete[] fio;
  50. cout << "Destructor is working." << endl;
  51. }
  52. double vichisl_nach_summ();
  53. double vichisl_yder_summ();
  54. double vichisl_zp();
  55. void set();
  56. void show();
  57. };
RAW Paste Data