-
Notifications
You must be signed in to change notification settings - Fork 0
/
Course.h
63 lines (56 loc) · 1.33 KB
/
Course.h
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
// Course Class
#pragma once
#include <vector>
#include <iostream>
#include "Student.h"
#include "Faculty.h"
class Course
{
public:
Course(){}
~Course(){}
void setName(std::string n) { name = n; }
void setCapacity(int c) { capacity = c; }
void setInstructor(Faculty i) { instructor = i; }
void addStudent(Student s)
{
if (students.size() < capacity)
students.push_back(s);
else
std::cout << "Course capacity reached..." << std::endl;
}
void listCourseInfo(bool isStu, bool isIns)
{
std::cout << std::endl << "Course Name: \t\t" << name << std::endl << "Capacity: \t\t" << capacity << std::endl << std::endl;
if (isIns == false)
{
std::cout << std::endl << "There is no instructor assigned to this course." << std::endl;
}
else
{
std::cout << "Instructor: " << instructor << std::endl;
}
if (isStu == false)
{
std::cout << std::endl << "There are no students assigned to this course." << std::endl;
}
else
{
std::cout << "Students: " << std::endl;
for (int i = 0; i < students.size(); ++i)
{
std::cout << students[i] << std::endl;
}
}
}
int getCapacity() { return students.size(); }
/*void sortStudents()
{
< students;
}*/
private:
std::string name;
std::vector<Student> students;
Faculty instructor;
int capacity;
};