-
Notifications
You must be signed in to change notification settings - Fork 0
/
ncku_credit.cpp
79 lines (71 loc) · 1.79 KB
/
ncku_credit.cpp
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
67
68
69
70
71
72
73
74
75
76
77
78
79
#include<bits/stdc++.h>
#include "ncku_credit.h"
using namespace std;
void NCKU::set_compulsory(int number,string subject)
{
this->compulsory+=number;
subject_compulsory.push_back(subject);
}
int NCKU::get_compulsory()
{
return this->compulsory;
}
void NCKU::set_elective(int number,string subject)
{
this->elective+=number;
subject_elective.push_back(subject);
}
int NCKU::get_elective()
{
return this->elective;
}
void NCKU::set_general(int number,string subject)
{
this->general+=number;
subject_general.push_back(subject);
}
int NCKU::get_general()
{
return this->general;
}
int NCKU::get_credit_need()
{
this->total=this->compulsory+this->elective+this->general;
return this->total;
}
void NCKU::set_compulsory_haven_learn(int number)
{
this->compulsory_haven_learn+=number;
}
void NCKU::set_elective_haven_learn(int number)
{
this->elective_haven_learn+=number;
}
void NCKU::set_general_haven_learn(int number)
{
this->general_haven_learn+=number;
}
int NCKU::get_compulsory_haven_learn()
{
return this->compulsory_haven_learn;
}
int NCKU::get_elective_haven_learn()
{
return this->elective_haven_learn;
}
int NCKU::get_general_haven_learn()
{
return this->general_haven_learn;
}
void NCKU::comparing(string subject_get)
{
for(int i=0;i<subject_compulsory_haven_learn.size();i++)
if(subject_get==subject_compulsory_haven_learn.at(i))
subject_compulsory_haven_learn.erase(subject_compulsory_haven_learn.begin()+i);
for(int i=0;i<subject_elective_haven_learn.size();i++)
if(subject_get==subject_elective_haven_learn.at(i))
subject_elective_haven_learn.erase(subject_elective_haven_learn.begin()+i);
for(int i=0;i<subject_general_haven_learn.size();i++)
if(subject_get==subject_general_haven_learn.at(i))
subject_general_haven_learn.erase(subject_general_haven_learn.begin()+i);
}