---UPDATED ---
I have problems when including headers and cpp files in my project, so here are the files: Person.h
#ifndef PERSON_H
#define PERSON_H
class Person {
private:
string firstName;
string lastName;
long NID;
public:
Person();
void toString();
string get_firstName() {
return firstName;
}
string get_lastName() {
return lastName;
}
long get_NID() {
return NID;
}
};
#endif
Teacher which extends Person Teacher.h
#include "Person.h"
#include <iostream>
#ifndef TEACHER_H
#define TEACHER_H
class Teacher : public Person {
private:
int avg_horarium;
public:
Teacher();
void toString();
int get_avg_horarium() {
return avg_horarium;
}
};
#endif
Then here is Teacher.cpp:
#include "Teacher.h"
using namespace std;
Teacher::Teacher() : Person() {
cout << "Enter average monthly horarium: ";
cin >> avg_horarium;
}
void Teacher::toString() {
Person::toString();
cout << "Average monthly horarium: " << avg_horarium;
}
The other class which extends Person is Student and since it's similar to teacher i won't poste it here. My question is what am i doing wrong to get all these errors on the screenshot: http://s14.postimage.org/45k08ckb3/errors.jpg