-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathStudent.java
More file actions
38 lines (27 loc) · 847 Bytes
/
Student.java
File metadata and controls
38 lines (27 loc) · 847 Bytes
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
package students.coreyscott;
public class Student extends Person {
private int gradeLevel;
private double gpa;
public Student(int id, String firstname, String lastname, String email, int gradeLevel, double gpa) {
super(id, firstname, lastname, email);
this.gradeLevel = gradeLevel;
this.gpa = gpa;
}
public boolean isOnHonorRoll() {
return gpa >= 3.5;
}
@Override
public String getSummary() {
String honorRollStatus = isOnHonorRoll() ? "Yes" : "No";
return "[Student]: " + getFullName() +
" | Grade Level: " + gradeLevel +
" | GPA: " + gpa +
" | Honor roll: " + honorRollStatus;
}
public int getGradeLevel() {
return gradeLevel;
}
public double getGpa() {
return gpa;
}
}