-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.cpp
40 lines (32 loc) · 981 Bytes
/
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
#include "student.h"
Student::Student() : admissionNumber(0), borrowedBookID(0), tokens(0) {
strcpy(studentName, "");
}
void Student::createStudent() {
cout << "\nEnter admission number: ";
cin >> admissionNumber;
cin.ignore();
cout << "\nEnter student name: ";
cin.getline(studentName, 50);
}
void Student::displayStudent() const {
cout << "\nAdmission Number: " << admissionNumber;
cout << "\nName: " << studentName;
cout << "\nBorrowed Book ID: " << borrowedBookID;
cout << "\nTokens: " << tokens;
}
void Student::listStudents() const {
cout << admissionNumber << "\t" << studentName << "\t" << borrowedBookID << "\t" << tokens << endl;
}
void Student::setToken(int token) {
tokens = token;
}
void Student::resetToken() {
tokens = 0;
}
int Student::getBorrowedBookID() const {
return borrowedBookID;
}
int Student::getAdmissionNumber() const {
return admissionNumber;
}