Course.h
Code:
#ifndef COURSE_H
#define COURSE_H
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Course{
private:
string CourseName;
int CourseNo;
vector<int> EnrolledStudents;
static int NextCourseNo;
const int MaxNoPlaces;
int FilledPlaces;
public:
Course(string cn, int MaxNoPlaces);
~Course();
bool enrollInStudent(int StudentNo);
int getMaxNoPlaces();
};
inline Course::Course(string cn, int MaxNoPlaces = 25) : MaxNoPlaces(MaxNoPlaces){
MaxNoPlaces = MaxNoPlaces;
CourseName = cn;
NextCourseNo++;
CourseNo = NextCourseNo;
}
inline int Course::getMaxNoPlaces(){
return MaxNoPlaces;
}
#endif
Student.h
Code:
#ifndef STUDENT_H
#define STUDENT_H
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Student{
private:
int StudentNo;
static int NextStudentNo;
string StudentName;
vector<int> EnrolledCorses;
public:
void displayEnrolledCorses();
Student(string sn);
~Student();
string getStudentName();
int getStudentNo();
void enrollInCourse(int courseNo);
};
inline Student::Student(string sn){
StudentName = sn;
NextStudentNo++;
StudentNo = NextStudentNo;
}
inline Student::~Student(){}
inline string Student::getStudentName(){
return StudentName;
}
inline int Student::getStudentNo(){
return StudentNo;
}
#endif