1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#ifndef STUDENT_H_INCLUDED
#define STUDENT_H_INCLUDED
#include <iostream>
#include <cstring>
#include <cassert>
#include <fstream>
#include <cmath>
using namespace std;
struct course
{
string code, title;
int credit, mark ;
};
class student
{
private:
string ID, name;
float GPA;
int numberOfCourses ;
course *p;
public:
void set(ifstream&, string, string, int);
void calculateGPA( );
float getGPA( )const;
int getNumberOfCourses( )const;
void print( )const;
~student();
student(ifstream&, string = "", string = "", int = 0);
student(const student&);
};
#endif // STUDENT_H_INCLUDED
[code]
The TA header:-
[code]#ifndef TA_H_INCLUDED
#define TA_H_INCLUDED
#include "Student.h"
class TA: public student
{
private:
string department;
float rating ,salary;
int numberOfHours;
public:
void calculateSalary();
void set(ifstream&, string, string, int,string, int, float);
float getSalary()const;
void print()const;
TA(ifstream&, string = "", string = "", int = 0,string = "", int = 0, float = 0.0);
};
#endif // TA_H_INCLUDED
|