Advertisement
Guest User

Untitled

a guest
Dec 27th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #ifndef SALARYTABLE_H_
  2. #define SALARYTABLE_H_
  3.  
  4. class SalaryTable {
  5. public:
  6. SalaryTable();
  7. ~SalaryTable();
  8.  
  9. unsigned int annualSalary(unsigned int grade) const;
  10. };
  11.  
  12. #endif /* SALARYTABLE_H_ */
  13.  
  14. #ifndef PERSON_H_
  15. #define PERSON_H_
  16.  
  17. #include <string>
  18. #include <iosfwd>
  19. #include <vector>
  20.  
  21. #include "SalaryTable.h"
  22.  
  23. using std::vector;
  24. using std::string;
  25.  
  26. class Person {
  27. public:
  28. Person() = delete;
  29. Person(const Person&) = delete;
  30. Person(Person&&) = delete;
  31.  
  32. Person(const char* name);
  33. Person(const std::string& name);
  34. virtual ~Person();
  35.  
  36. // Return the name of the Person
  37. // Should be supported by all Persons.
  38. std::string name() const;
  39.  
  40. virtual std::string toString() const=0;
  41.  
  42. virtual std::string type() const=0;
  43.  
  44. friend std::ostream& operator<<(std::ostream&, const Person&);
  45. private:
  46. std::string name_;
  47. };
  48.  
  49. class Student: public Person {
  50. public:
  51. Student() = delete;
  52. Student(const Student&) = delete;
  53. Student(Student&&) = delete;
  54.  
  55. Student(const char* name, unsigned int studentId);
  56. Student(const std::string& name, unsigned int studentId);
  57. virtual ~Student();
  58.  
  59. void addMCF(const std::string&);
  60. std::string MCF(unsigned int);
  61.  
  62. unsigned int id() const;
  63.  
  64. std::string toString() const;
  65. std::string type() const;
  66.  
  67. private:
  68. unsigned int studentId_;
  69. vector<string> vec_;
  70. };
  71.  
  72. class Lecturer: public Person {
  73. public:
  74. Lecturer() = delete;
  75. Lecturer(const Lecturer&) = delete;
  76. Lecturer(Lecturer&&) = delete;
  77.  
  78. Lecturer(const char* name, const char* teaches, unsigned int grade,
  79. SalaryTable*);
  80. Lecturer(const std::string& name, const std::string& teaches,
  81. unsigned int grade, SalaryTable*);
  82. virtual ~Lecturer();
  83.  
  84. void increaseGrade();
  85. unsigned int salary() const;
  86.  
  87. void changeModule(const std::string& newModule);
  88. std::string teaches() const;
  89.  
  90. std::string toString() const;
  91. std::string type() const;
  92.  
  93. private:
  94. string teaches_;
  95. string module_;
  96. unsigned int grade_;
  97. SalaryTable* salaryTable_;
  98.  
  99. };
  100.  
  101. #endif /* PERSON_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement