-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
71 lines (57 loc) · 1.68 KB
/
Student.java
File metadata and controls
71 lines (57 loc) · 1.68 KB
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
public class Student extends User{
private String studentName;
private String email;
private String hashedPassword;
private int noOfPresents = 0;
private int noOfAbsents = 0;
// Constructor
public Student(int studentId, String studentName, String email, String hashedPassword) {
this.UserID = studentId;
this.studentName = studentName;
this.email = email;
this.hashedPassword = hashedPassword;
}
public Student(int studentId, String studentName, String email, String hashedPassword, int noOfPresents, int noOfAbsents) {
this(studentId, studentName, email, hashedPassword);
this.noOfPresents = noOfPresents;
this.noOfAbsents = noOfAbsents;
}
// Getters
public int getStudentId() {
return UserID;
}
public String getStudentName() {
return studentName;
}
public String getEmail() {
return email;
}
public String getHashedPassword() {
return hashedPassword;
}
public int getNoOfPresents() {
return noOfPresents;
}
public int getNoOfAbsents() {
return noOfAbsents;
}
// Setters
public void setStudentId(int studentId) {
this.UserID = studentId;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public void setEmail(String email) {
this.email = email;
}
public void setHashedPassword(String hashedPassword) {
this.hashedPassword = hashedPassword;
}
public void markPresent() {
this.noOfPresents++;
}
public void markAbsent() {
this.noOfAbsents++;
}
}