// save class TestStudent in file TestStudent.java public class TestStudent { public static void report(Student s) { System.out.println(" STUDENT \t" +s.getName()); System.out.println(" TEST1 \t" + s.getTest1()); System.out.println(" TEST2 \t" + s.getTest2()); System.out.println(" TEST3 \t" + s.getTest3()); System.out.println(" MaxScore\t" + s.maxScore()); System.out.println(" MinScore\t" + s.minScore()); System.out.println(" AveScore\t" + s.average()); if (s.isAscending()) System.out.println("Student " +s.getName()+ "\'s scores are increasing" ); else System.out.println("Student " +s.getName()+ "\'s scores are not increasing"); System.out.println("********************************"); System.out.println(); } public static void main( String[] args) { Student s1 = new Student( "Bill", 6, 8, 9); Student s2 = new Student( "Tom", 9, 8, 9); Student s3 = new Student( "Anna", 10, 9, 9); Student s4 = new Student( "Kelly", 9); report(s1); report(s2); report(s3); report(s4); } } ///////////////////////////////////////////////////////////////////////////////////////// // save class Student in file Student.java public class Student { private String name; // student name private int test1; // first test private int test2; private int test3; // constuctor to create student object public Student(String studentname, int t1, int t2, int t3) { name = studentname; test1= t1; test2= t2; test3= t3; } // constuctor to create student object with same // scores for all tests public Student(String studentname, int test) { name = studentname; test1= test; test2= test; test3= test; } // method that returns the highest test score public int maxScore() { int max = test1; if (test2 > max) max = test2; if (test3 > max) max = test3; return max; } // method that returns the lowest test score public int minScore() { int min = test1; if (test2 < min) min = test2; if (test3 < min) min = test3; return min; } //method to return average score public int average() { return (int) ( (test1+test2+test3)/3.0 + 0.5); } // method to return true if tests are in ascending order // and false otherwise public boolean isAscending() { return test3 > test2 && test2 > test1; } // method to return student name public String getName() { return name; } // method to return test1 public int getTest1() { return test1; } // method to return test2 public int getTest2() { return test2; } // method to return test3 public int getTest3() { return test3; } public String toString() { return "STUDENT "+name +" " +test1 +" " +test2 +" " +test3 ; } }