// edit ranks public void editRankings(ArrayList<School> H) { int schoolRanking, nSchools = this.rankings.length; String schoolPrompt, yesOrNo; yesOrNo = BasicFunctions.getYesOrNo("Edit rankings (y/n): "); if (yesOrNo.equalsIgnoreCase("N")) { System.out.println(); return; } System.out.printf("\nStudent %s's rankings:\n", this.getName()); // for loop handles schools for (int i = 0; i < nSchools; i++) { // initialize the prompt schoolPrompt = "School " + H.get(i).getName() + ": "; // get the correct input from user for rank do { schoolRanking = BasicFunctions.getInteger(schoolPrompt, 1, nSchools); } while (this.rankingUsed(i, schoolRanking)); // set that to be the rank this.setRanking(i, schoolRanking); } // end for loop } // end editRankings method
public void editInfo(ArrayList<School> H) { this.setName(BasicFunctions.getString("Name: ")); this.setGPA(BasicFunctions.getDouble("GPA: ", 0, _GPA_MAX_VALUE_)); this.setES(BasicFunctions.getInteger("Extracurricular score: ", 0, _ES_MAX_VALUE_)); this.editRankings(H); // will only fully execute if user wants it to System.out.println(); } // user info