-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathStudent.java
More file actions
30 lines (24 loc) · 828 Bytes
/
Student.java
File metadata and controls
30 lines (24 loc) · 828 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
package students.jaydenandrews;
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;
}
@Override
public void getSummary() {
System.out.println("[Student] " + this.getFirstName() + " " + this.getLastName() + " | " +
"Grade Level: " + this.gradeLevel + " | GPA: " + this.gpa + " | Honor Roll: " + isOnHonorRoll());
}
public int getGradeLevel() {
return gradeLevel;
}
public double getGpa() {
return gpa;
}
public String isOnHonorRoll() {
return (this.gpa > 3.0 ? "Yes" : "No");
}
}