Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Controller {
- public static Annuity thisAnnuity;
- public static PresentValue thisPresentValue;
- public static ArrayList<PresentValue> pPresentValue;
- public static void main(String[] args)
- {
- Annuity thisAnnnuity = new Annuity();
- thisAnnnuity.setPayment();
- thisAnnnuity.setTerm();
- thisAnnnuity.setRate();
- thisAnnnuity.setType();
- ArrayList<Annuity> pAnnuity = new ArrayList<Annuity>();
- 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);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement