import java.util.ArrayList; public class CollegeGroup { private College[] myColleges = { new CollegeImpl("Colgate University", College.NORTHEAST, 27025), new CollegeImpl("Duke University", College.SOUTHEAST, 26000), new CollegeImpl("Kalamazoo College", College.MIDWEST, 19764), new CollegeImpl("Stanford University", College.WEST, 25917), new CollegeImpl("Florida International University", College.SOUTHEAST,10800), new CollegeImpl("Dartmouth College", College.NORTHEAST, 27764), new CollegeImpl("Spelman College", College.SOUTHEAST, 11455) }; // precondition: there exists a College in this group // whose name is collegeName, call this // myColleges[index] // postcondition: myColleges[index].getTuition() == newTuition, i.e., // the College with collegeName has // newTuition as its tuition public void updateTuition(String collegeName, int newTuition) { for(int k=0; k < myColleges.length; k++){ College coll = myColleges[k]; if (coll.getName().equals(collegeName)){ myColleges[k] = new CollegeImpl(coll.getName(), coll.getRegion(), newTuition); } } } public ArrayList getCollegeList(String region, int low, int high) { ArrayList list = new ArrayList(); for(int k=0; k < myColleges.length; k++){ College coll = myColleges[k]; if (coll.getRegion().equals(region) && low <= coll.getTuition() && coll.getTuition() <= high){ list.add(coll); } } return list; } }