/*-------------Java Project - StudentName: Irfan Ayub-------------*/import java.util.*; // provides the ArrayList classpublic class ModuleDataStore{ // begin class ModuleDatStoreaArrayList data; // declares an ArrayList object called 'data'/* The constructor method. Creates the ArrayList object 'data' */public ModuleDataStore() { // begin constructor method */data = new ArrayList();} // end constructor method *//* Adds a new student data entry to the ArrayList 'data' */public void addNewStudentRecord(String aNumber, String aName, int mark1, int mark2){ // begin addNewStudentEntry method */ Student aStudent; aStudent =new Student(aNumber,aName,mark1,mark2); data.add(aStudent);} // end addNewStudentRecord method *//* Returns, as a String, the number, name and the two test marks of every student currently stored in the ArrayList 'data'. */public String toString(){ // begin toString() method String details=""; //creates an empty string for(int i=0;i<data.size();i++) //loop through the arraylist { Student aStudent=(Student) //get the student data.get(i); //get the student at current i position in array list details+=aStudent.toString()+"\n"+"\n"+"\n"; //add its details to the string } return details; //return the string} // end toString() method/* returns the mark of the student with the specified name */public int getStudentRecord(String aNumber){ // begin methodfor(int i =0; i < data.size(); i++) //loop through all of the students in the list { Student aStudent = (Student) data.get(i); //get the student in the i'th position if(aStudent.getPNumber().equals(aNumber)) //is it the student being searched for? { return aStudent.getTest1(); //if so then return it's test 1 mark } } // end for return -1; // This will be done if the student is not found to inform the program} // end getStudentRecord() methodpublic String getStudentGrade(String aNumber){ // begin getStudentGrade method//You will need to loop through the ArrayList dataStore to retrieve the specified Student object for(int i=0;i<data.size();i++) //loop through all of the students in the list { Student aStudent = (Student) data.get(i); //get the student in the i'th position if (aStudent.getPNumber().equals(aNumber)) //is it the student being searched for? { return aStudent.getGrade(); //if so then return it's grade } } return -1; // This will be done if the cat is not found to inform the program}} // end class ModuleDataStore/*STUDENT CLASS*//* Returns the student's overall module mark */ public int getModuleMark() { int total = (test1 + test2)/2; return total; }/*computes grade letter*/ public String getGrade() { int mark=this.getModuleMark(); if (mark<=29) { return "F"; } else if(mark>29 && mark<40) { return "U"; } else if(mark>39 && mark<50) { return "D"; } else if(mark>49 && mark<60) { return "C"; } else if(mark>59 && mark<70) { return "B"; } else if(mark>69 && mark<80) { return "A"; } else { return "A**"; } }