home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CPTUTOR2.ZIP / ANSWERS.ARC / CH11_1A.HPP < prev    next >
Text File  |  1990-07-20  |  1KB  |  49 lines

  1.                             // Chapter 10 - Programming exercise 1
  2. #ifndef SUPERVSRHPP
  3. #define SUPERVSRHPP
  4.  
  5. // This defines three subclasses of the parent type person. Different
  6. //  data is stored for the different job classifications to illustrate
  7. //  that it can be done.
  8.  
  9. #include "person.hpp"
  10.  
  11. class supervisor : public person {
  12.    char title[25];
  13. public:
  14.    void init_data(char in_name[], int in_salary, char in_title[]);
  15.    void display(void);
  16. };
  17.  
  18.  
  19.  
  20. class programmer : public person {
  21.    char title[25];
  22.    char language[25];
  23. public:
  24.    void init_data(char in_name[], int in_salary, char in_title[],
  25.                   char in_language[]);
  26.    void display(void);
  27. };
  28.  
  29.  
  30.  
  31. class secretary : public person {
  32.    char shorthand;
  33.    int typing_speed;
  34. public:
  35.    void init_data(char in_name[], int in_salary,
  36.                   char in_shorthand, char in_typing_speed);
  37.    void display(void);
  38. };
  39.  
  40.  
  41. class consultant : public person {
  42.    char title[25];
  43. public:
  44.    void init_data(char in_name[], int in_salary, char in_title[]);
  45.    void display(void);
  46. };
  47.  
  48. #endif
  49.