For this assignment, you will complete a class which will be used to find statistics on an array of Student objects.
The class, StudentStatsArray, needs to store an array of Student objects as a member variable. This should be declared as private and final, so none of your methods will set this variable to point at a different array. The single constructor for this class has a parameter of a Student array, and should set the member variable to point to this parameter array.

The member variables and methods of the Student class are as follows:

Variables
String name - the name of the student
double gpa - the student's GPA (0-4.0 inclusive)
int year - the student's year (1-4 inclusive)
Methods
String getName() - returns the name of this student
double getGpa() - returns the GPA of this student
int getYear() - returns this students year
String toString () - return a String representing this student in a JSON like format, which is as follows: 
{ 
    name: <student's name>,
    gpa: <student's gpa>,
    year: <student's year>
}
After inspecting the code for the Student class, you will need to complete the following methods in the StudentStatsArray class (you may assume that the member variable array is not empty when writing these methods):

Variables
Student[] students - the array of student objects
Methods
double averageGpa() - returns the average GPA of the student's in the students array
double getGpaRange() - returns the range of the GPAs of the student's in the students array
String getLongestName() - returns the name of the student with the longest name in the students array
int getNumFreshman() - returns the number of freshman (year = 1) in the students array
int search(String name) - returns the index of the first student with a name equal to name. If there are no students with a name equal to name, the method should return -1.
int search(double gpa) - return the index of the first student with a gpa greater than or equal to gpa. If there are no students with a gpa greater than or equal to gpa, the method should return -1.
int sortStatus() - returns 1 if the students are sorted in ascending order by their gpa and -1 if in descending order. Make sure to take into account that the array can still be sorted in ascending or descending order if two or more students in consecutive indices have the same GPA. If all students have the same GPA, then return 1. Return 0 in all other cases.
String toString() - returns a string representing the students array in a format similar to JSON. The format is as follows:
[
{
    name: <student[0] name>,
    gpa: <student[0] gpa>,
    year: <student[0] year>
},
…
{
    name: <student[length -1] name>,
    gpa: <student[length - 1] gpa>,
    year: <student[length - 1] year>
},
]        
You should use the runner_StudentStatsArray class to test your classes. Do not add a main method to the Student.java or StudentStatsArray.java files, as it will cause your submission to be scored incorrectly.

Remember not to have spaces between your brackets, as a space will also cause your submission to be scored incorrectly.

Hint: If you notice unexpected whitespace in your output, consider using the .trim() method to remove leading or trailing spaces from your string before submitting your code.