import java.util.Scanner; import java.util.ArrayList; public class CreditUnion{ ArrayList homeBuyers = new ArrayList(); public ArrayList getPreApprovedList(){ ArrayList approvedHomeBuyerList = new ArrayList(); for (HomeBuyer buyer:homeBuyers){ if (buyer.getCreditScore()>=700){ approvedHomeBuyerList.add(buyer); } } return approvedHomeBuyerList; } public void addHomeBuyer(HomeBuyer buyer){ homeBuyers.add(buyer); } public void inputBuyer(Scanner scnr){ HomeBuyer currBuyer; int quitFlag = 0; String fName; String lName; int creditRating; while (true){ System.out.print("Type a negative #; positive to continue: "); quitFlag = scnr.nextInt(); if (quitFlag < 0){break;} System.out.print("Type first name last name credit rating: "); fName = scnr.next(); lName = scnr.next(); creditRating = scnr.nextInt(); currBuyer = new HomeBuyer(fName, lName, creditRating); addHomeBuyer(currBuyer); } } }