-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathStudent.java
More file actions
36 lines (32 loc) · 957 Bytes
/
Student.java
File metadata and controls
36 lines (32 loc) · 957 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
package students.fredainsworth;
public class Student extends Person {
private int gradeLevel;
private double gpa;
public Student(String firstName, String lastName, int gradeLevel, double gpa) {
super(firstName, lastName);
this.gradeLevel = gradeLevel;
this.gpa = gpa;
}
@Override
public void getSummary() {
System.out.println("Student: "+this.getFirstName()+" "+this.getLastName()+" | Grade level: "+ getGradeLevel()+"| GPA: "+getGpa()+"| "+ this.honorRoll());
}
public int getGradeLevel() {
return gradeLevel;
}
public void setGradeLevel(int gradeLevel) {
this.gradeLevel = gradeLevel;
}
public double getGpa() {
return gpa;
}
public void setGpa(double gpa) {
this.gpa = gpa;
}
public String honorRoll(){
if (gpa>3.0){
return "Honor Roll: Yes";
}else
return "Honor Roll: No";
}
}