public class Controller { public static Annuity thisAnnuity; public static PresentValue thisPresentValue; public static ArrayList pPresentValue; public static void main(String[] args) { Annuity thisAnnnuity = new Annuity(); thisAnnnuity.setPayment(); thisAnnnuity.setTerm(); thisAnnnuity.setRate(); thisAnnnuity.setType(); ArrayList pAnnuity = new ArrayList(); int counter = 0; if(Annuity.getType = "0") while(counter != thisAnnuity.getTerm()) { counter++; thisAnnuity = new Annuity(counter, thisAnnuity.getPayment(), thisAnnuity.getRate(), thisAnnuity.getPVOFactor); pPresentValue.add(thisPresentValue); thisAnnuity.set(thisPresentValue.getPresentValue()); } if(Annuity.getType = "1") while(counter != thisAnnuity.getTerm()) { counter++; thisAnnuity = new Annuity(counter, thisAnnuity.getPayment(), thisAnnuity.getRate(), thisAnnuity.getPVOFactor); pPresentValue.add(thisPresentValue); thisAnnuity.set(thisPresentValue.getPresentValue()); } else { System.err.println("Invalid Annuity Type: Please enter either 0 or 1"); } System.out.println("Annuity [Payment= " + pPayment + ", Term= " + pTerm + ", Rate= " + rate + ", Type= " + pType + "]"); System.out.println("Present Value = $" + pPresentValue); System.out.println("PV Factor = " + pPVOFactor); }