All pastes #396849 Raw Edit

getStudentGrade

public java v1 · immutable
·published 2007-03-16 01:56 UTC
rendered paste body
public 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}