fork download
  1. #ifndef _EMP_H_
  2. #define _EMP_H_
  3.  
  4. #include <cstring>
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. const int SLEN = 20;
  9.  
  10. class employee
  11. {
  12. protected:
  13. char fname[SLEN];
  14. char lname[SLEN];
  15. char job[SLEN];
  16. virtual void ShowData();
  17.  
  18. public:
  19. employee();
  20. employee(char * fn, char * ln, char * j);
  21. employee(const employee & e );
  22. virtual ~employee(){ };
  23. virtual void ShowData() const {};
  24. virtual void ShowAll() const;
  25. virtual void SetAll();
  26.  
  27. friend ostream& operator<<(ostream& os, const employee & e);
  28.  
  29. };
  30.  
  31.  
  32. class manager: virtual public employee
  33. {
  34. protected:
  35. int inchargeof;
  36.  
  37. void SetData();
  38. void ShowData() const override;
  39.  
  40. public:
  41. manager();
  42. manager(char * fn, char * ln, char * j, int ico = 0);
  43. manager(const employee & e, int ico);
  44. manager(const manager & m );
  45. void ShowAll() const;
  46. void SetAll();
  47.  
  48. };
  49.  
  50. class fink: virtual public employee
  51. {
  52. protected:
  53. char reportsto[SLEN];
  54.  
  55. void SetData();
  56. void ShowData() const override;
  57. public:
  58. fink();
  59. fink(char * fn, char * ln, char * j, char * rpo);
  60. fink(const employee & e, char * rpo );
  61. fink(const fink & f);
  62.  
  63. void ShowAll() const;
  64. void SetAll();
  65.  
  66. };
  67.  
  68.  
  69. class highfink: public manager, public fink
  70. {
  71. public:
  72. highfink();
  73. highfink(char * fn, char * ln, char * j, char * rpo, int ico);
  74. highfink(const employee & e, char * rpo, int ico);
  75. highfink(const fink & f, int ico);
  76. highfink(const manager & m, char* rpo);
  77. highfink(const highfink & h);
  78.  
  79. void ShowAll() const;
  80. void SetAll();
  81.  
  82. private:
  83. void ShowData() const override {};
  84. };
  85.  
  86. int main()
  87. {
  88. return 0;
  89. }
  90.  
  91. #endif
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
Standard output is empty