My code:
public ArrayList<Grade> grades;
grades = new ArrayList<Grade>();
public Grade getLowestGrade()
{
Grade lowestGrade = grades.get(0);
for (int i = 1; i < grades.size(); i++)
{
Grade g = grades.get(i);
if(s.getGrade() < lowestGrade.getGrade())
lowestGrade = g;
}
return lowestYet;
}
This code is in my Student class using the grades ArrayList.
In my tester I have:
Student getLowestGrade = new Student();
getLowestGrade.getLowestGrade();
My question is what am I missing to get this to print the lowestGrade out to my tester.