-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudent.cpp
executable file
·62 lines (50 loc) · 1.26 KB
/
Student.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
// Jaden Heller
// 2328279
// CPSC-350-01
// Assignment 6
#include "Student.h"
Student::Student(){ //Default initializes the three variables unique to Student (that Person.h
//doesnt have)
major;
gpa;
advisorID;
}
Student::Student(int st_id, string st_name, string st_level, string st_major, double st_gpa, int st_advisor){
idNum = st_id;
name = st_name;
level = st_level;
major = st_major;
gpa = st_gpa;
advisorID = st_advisor;
}
Student::~Student(){
}
//"Set" functions:
void Student::setMajor(string studentMajor){
major = studentMajor;
}
void Student::setGPA(double studentGrade){
gpa = studentGrade;
}
void Student::setAdvisor(int studentAdvisorID){
advisorID = studentAdvisorID;
}
//"Get" functions:
string Student::getMajor(){
return major;
}
double Student::getGPA(){
return gpa;
}
int Student::getStudentsAdvisor(){
return advisorID;
}
void Student::printInfo(){
cout << "ID Number: " << getID() << endl;
cout << "Name: " << getName() << endl;
cout << "Level: " << getLevel() << endl;
cout << "Major: " << major << endl;
cout << "GPA: " << gpa << endl;
cout << "Advisor's ID: " << advisorID << endl;
}