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