summaryrefslogtreecommitdiff
path: root/CPP/Basics/Ex2/records.h
blob: c0e92c6e2bae9fd4db6fe50da675c9c8bf374846 (plain)
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
#ifndef RECORDS_H
#define RECORDS_H

#include <vector>
#include <string>

class Student{
private:
	int id;
	std::string name;

public:
	Student(int the_id, std::string the_name);
	int get_id();
	std::string get_name();
};

class Course{
private:
	int id;
	std::string name;
	unsigned char credits;

public:
	Course(int the_id, std::string the_name, unsigned char the_credits);
	int get_id();
	std::string get_name();
	int get_credits();
};

class Grade{
private:
	int student_id;
	int course_id;
	char grade;

public:
	Grade(int sid, int cid, char grd);
	int get_student_id();
	int get_course_id();
	char get_grade();
};

class StudentRecords {
private:
	std::vector<Student> students;
	std::vector<Course> courses;
	std::vector<Grade> grades;

	float get_num_grade(char);

public:
	void add_student(int, std::string);
	void add_course(int, std::string, unsigned char);
	void add_grade(int, int, char);

	std::string get_student_name(int);
	unsigned char get_course_credits(int);
	float get_GPA(int);
	void report_card(int);
};

#endif /* RECORDS_H */