Hi everyone,
I am trrying to figure out the difference between a base class and a derived class.
If a class includes another class, does that make it the derived class?
And the included class the base?
Thnx.
Kim
#ifndef HOURLY_H
#define HOURLY_H
#include "employ.h"
class HourlyWorker : public Employee {
public:
HourlyWorker( const char*, const char*, double, double );
double getPay() const;
void print() const;
private:
double wage;
double hours;
};
#endif
#ifndef EMPLOY_H
#define EMPLOY_H
class Employee {
public:
Employee( const char *, const char * ); // constructor
void print() const;
~Employee();
private:
char *firstName;
char *lastName;
};
#endif