-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStudent.java
More file actions
89 lines (68 loc) · 1.7 KB
/
Student.java
File metadata and controls
89 lines (68 loc) · 1.7 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class Student extends Person implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
// Data Field
private Double gpa;
private String major;
private Integer credits;
List<Courses> courses;
List<Courses> inProgress;
List<Courses> remaining;
// Constructor
public Student(String fName, String lName, Integer id, Integer phone,
String home) {
super(fName, lName, id, phone, home);
courses = new ArrayList<>();
inProgress = new ArrayList<>();
remaining = new ArrayList<> ();
}
// getters and setters
public Double getGpa() {
return gpa;
}
public void setGpa(Double gpa) {
this.gpa = gpa;
}
@Override
public String toString() {
String temp = super.toString();
return "Student [" +temp.substring(8, temp.length()-1) +"," + " gpa=" + gpa + ", major=" + major + ", credits="
+ credits + ", courses=" + courses + ", inProgress="
+ inProgress + ", remaining=" + remaining + "]";
}
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public Integer getCredits() {
return credits;
}
public void setCredits(Integer credits) {
this.credits = credits;
}
public List<Courses> getCourses() {
return courses;
}
public void setCourses(List<Courses> courses) {
this.courses = courses;
}
public List<Courses> getInProgress() {
return inProgress;
}
public void setInProgress(List<Courses> inProgress) {
this.inProgress = inProgress;
}
public List<Courses> getRemaining() {
return remaining;
}
public void setRemaining(List<Courses> remaining) {
this.remaining = remaining;
}
}