Click to go home
// class Employee interface
#ifndef _EMPLOYEE_HPP
#define _EMPLOYEE_HPP
#include "String.hpp"
class Employee
{
protected:
float grossPay; // protected data members
private:
String name;
float monthlySalary; // private data members
public:
Employee(); // public class methods
Employee(char* nm,float monthly);
Employee(char ch,float monthly);
Employee(String& obj,float monthly);
Employee(Employee& obj);
virtual ~Employee();
Employee& operator=(Employee& obj);
char* getName();
void setName(char* nm);
void setName(char ch);
void setName(String& obj);
float getMonthlySalary();
void setMonthlySalary(float monthly);
float getGrossPay();
virtual void calcPay();
virtual void display();
};
#endif
// class FullTime interface
#ifndef _FULLTIME_HPP
#define _FULLTIME_HPP
#include "Employee.hpp"
class FullTime:public Employee // derived from Employee class
{
public:
FullTime(); // public class methods
FullTime(char* nm,float monthly);
FullTime(char ch,float monthly);
FullTime(String& obj,float monthly);
FullTime(FullTime& obj);
~FullTime();
FullTime& operator=(FullTime& obj);
void calcPay();
};
#endif
// class SalesPerson interface
#ifndef _SALESPERSON_HPP
#define _SALESPERSON_HPP
#include "Employee.hpp"
class SalesPerson:public Employee // derived from Employee class
{
private:
float commissionRate; // private data members
float sales;
public:
SalesPerson(); // public class methods
SalesPerson(char* nm,float monthly,float cRate,float s);
SalesPerson(char ch,float monthly,float cRate,float s);
SalesPerson(String& obj,float monthly,float cRate,float s);
SalesPerson(SalesPerson& obj);
~SalesPerson();
SalesPerson& operator=(SalesPerson& obj);
float getCommissionRate();
void setCommissionRate(float cRate);
float getSales();
void setSales(float s);
void calcPay();
void display();
};
#endif
// class String interface
#ifndef _STRING_HPP
#define _STRING_HPP
#include
class String
{
private: // private data members
int length;
char* str;
public: // public class methods
String();
String(char ch);
String(char* strng);
String(const String&);
~String();
int getLength();
char* getString();
String operator=(const String&);
String operator=(char*);
String operator=(char);
String operator+(const String&);
String operator+(char*);
String operator+(char);
void printString();
friend ostream& operator<<(ostream& out,String& obj);
};
#endif
// class Student interface
#ifndef _STUDENT_HPP
#define _STUDENT_HPP
#include "Employee.hpp"
class Student:public Employee // derived from Employee class
{
private:
float subsidy; // private data members
public:
Student(); // public class methods
Student(char* nm,float monthly,float subsdy);
Student(char ch,float monthly,float subsdy);
Student(String& obj,float monthly,float subsdy);
Student(Student& obj);
~Student();
Student& operator=(Student& obj);
float getSubsidy();
void setSubsidy(float subsdy);
void calcPay();
void display();
};
#endif
Next Page - Employee.cpp
Jump to:
FullTime.cpp |
SalesPerson.cpp |
String.cpp |
Student.cpp |
Driver
Go to top