Question: JAVA plz make code test for the following codes in the pictures thank you! public static void testIsGradeAbove() { // TODO: write tests for Lab2.isGradeAbove
JAVA plz make code test for the following codes in the pictures thank you!
public static void testIsGradeAbove() { // TODO: write tests for Lab2.isGradeAbove }
public static void testGetClasslist() { // TODO: write tests for Lab2.getClasslist
public static void testCountAbove() { // TODO: write tests for Lab2.countAbove
public static void testRegisterStudent() { // TODO: write tests for Lab2.registerStudent // HINT: the Student class also has a equals method so you // can use Arrays.equals again to compare 2 Student array



* /* * Purpose: determines whether the grade of Student s is above the threshold * Parameters: Student - s, int - threshold * Returns: boolean - true if grade is above threshold, false otherwise * Preconditions: s is not null */ // Todo: implement isGradeAbove public static boolean isGradeAbove (Student s, int threshold) { if (s.getGrade() >= threshold) { return true; }else{ return false; } } /* * Purpose: creates an array SIDs of all Students in students * Parameters: Student[] - students * Returns: String[] - array of SIDs * Preconditions: students is not null and contains no null elements */ // Todo: implement getclasslist public static String[] getclasslist (Student[] students) { String Array[]; int arrsize = students.length; Array = new String[arrsize]; for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
