Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SALARYTABLE_H_
- #define SALARYTABLE_H_
- class SalaryTable {
- public:
- SalaryTable();
- ~SalaryTable();
- unsigned int annualSalary(unsigned int grade) const;
- };
- #endif /* SALARYTABLE_H_ */
- #ifndef PERSON_H_
- #define PERSON_H_
- #include <string>
- #include <iosfwd>
- #include <vector>
- #include "SalaryTable.h"
- using std::vector;
- using std::string;
- class Person {
- public:
- Person() = delete;
- Person(const Person&) = delete;
- Person(Person&&) = delete;
- Person(const char* name);
- Person(const std::string& name);
- virtual ~Person();
- // Return the name of the Person
- // Should be supported by all Persons.
- std::string name() const;
- virtual std::string toString() const=0;
- virtual std::string type() const=0;
- friend std::ostream& operator<<(std::ostream&, const Person&);
- private:
- std::string name_;
- };
- class Student: public Person {
- public:
- Student() = delete;
- Student(const Student&) = delete;
- Student(Student&&) = delete;
- Student(const char* name, unsigned int studentId);
- Student(const std::string& name, unsigned int studentId);
- virtual ~Student();
- void addMCF(const std::string&);
- std::string MCF(unsigned int);
- unsigned int id() const;
- std::string toString() const;
- std::string type() const;
- private:
- unsigned int studentId_;
- vector<string> vec_;
- };
- class Lecturer: public Person {
- public:
- Lecturer() = delete;
- Lecturer(const Lecturer&) = delete;
- Lecturer(Lecturer&&) = delete;
- Lecturer(const char* name, const char* teaches, unsigned int grade,
- SalaryTable*);
- Lecturer(const std::string& name, const std::string& teaches,
- unsigned int grade, SalaryTable*);
- virtual ~Lecturer();
- void increaseGrade();
- unsigned int salary() const;
- void changeModule(const std::string& newModule);
- std::string teaches() const;
- std::string toString() const;
- std::string type() const;
- private:
- string teaches_;
- string module_;
- unsigned int grade_;
- SalaryTable* salaryTable_;
- };
- #endif /* PERSON_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement