standing 🌶️🌶️
Write a method that takes a Student parameter, s, and an int parameter, minAttendance, and returns a standing String. Return "Honor Roll" if s's score is 90 or above AND s's attendance is at least minAttendance. Return "Academic Probation" if s's score is below 60 OR s's attendance is below 60 (regardless of minAttendance). Otherwise, return "Satisfactory".
Reference: Student — the methods you can call
class Student
A student record: a name, a score and an attendance percentage. A Student never changes once it is made. You do not write this class; make a record with new Student(name, score, attendance) and call its methods.
Student s = new Student("Ana", 92, 97);
s.getName() // "Ana"
s.getLetterGrade() // "A"
s.isPassing() // true
s.toString() // "Ana: 92 (A), 97% attendance"
s.equals(new Student("Ana", 92, 97)) // true
| Method | What it does |
|---|---|
Student(String name, int score, int attendance) | Makes a student record.
|
String getName() | The student's name. Returns the name |
int getScore() | The student's score. Returns the score |
int getAttendance() | The attendance percentage. Returns the attendance percentage |
boolean isPassing() | Whether the student is passing. Returns true if the score is 60 or above |
String getLetterGrade() | The letter grade for the score, with the usual 90, 80, 70 and 60 cutoffs. Returns "A", "B", "C", "D" or "F" |
boolean equals(Object o) | Whether another object is a Student with the same name, score AND attendance.
Returns true if all three match; false otherwise |
String toString() | The student as text, for example "Ana: 92 (A), 97% attendance". It is called for you by Returns the student as text |