package project2; public class ScholarshipTester { public static void main(String[] args) { Scholar s1; Scholar s2; Scholar s3; Scholar s4; Scholar s5; Scholar s6; Scholar s7; Scholar s8; Scholarship sch; System.out.println("This program was written by S. Robbins"); s1 = new Scholar("John D. Rockefeller", 3.45, 3, 95, false); s2 = new Scholar("Albert Einstein", 2.91, 4, 40, true); s3 = new Scholar("Voltare", 2.91, 4, 70, false); s4 = new Scholar("James Joyce", 1.83, 4, 22, false); s5 = new Scholar("John Lewis", 2.57, 3, 75, true); s6 = new Scholar("William Loftus", 1.75, 2, 80, true); s7 = new Scholar("Bill Joy", 3.95, 3, 100, true); s8 = new Scholar("Al Einstein",2.91,4,40,true); sch = new Scholarship("Outstanding CS Student", 15000, 3); System.out.println("\nNothing added yet:"); showInfo(sch); sch.addApplicant(s1); sch.addApplicant(s2); System.out.println("\n2 added so far:"); showInfo(sch); sch.addApplicant(s3); sch.addApplicant(s4); System.out.println("\n4 added so far:"); showInfo(sch); sch.addApplicant(s5); sch.addApplicant(s6); sch.addApplicant(s7); sch.addApplicant(s8); System.out.println("\n8 added:"); showInfo(sch); String searchName = "John Doe"; System.out.println("\nSearch for "+searchName+" returned "+ sch.searchByName(searchName)); searchName = "John Lewis"; System.out.println("Search for "+searchName+" returned "+ sch.searchByName(searchName)); } private static void showInfo(Scholarship sch) { System.out.println(sch); System.out.println("Scholarship name: "+sch.getScholarshipName()); System.out.println("Number of applicants: "+sch.getNumApplicants()); System.out.println("Number of awardees: "+sch.getNumberAwardees()); System.out.println("Single scholarship amount: "+ sch.getSingleScholarshipAmount()); System.out.println("All applicants by name:"); sch.printAllApplicantsByName(); System.out.println("All applicants by score:"); sch.printAllApplicantsByScore(); System.out.println("And the winners are ..."); sch.printWinners(); System.out.println("Each award is $" + sch.getSingleScholarshipAmount()); } }