Want more features on Pastebin? Sign Up, it's FREE!
Guest

Controller Class

By: a guest on Mar 5th, 2012  |  syntax: None  |  size: 1.40 KB  |  views: 68  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Controller {
  2.  
  3.         public static Annuity thisAnnuity;
  4.         public static PresentValue thisPresentValue;
  5.         public static ArrayList<PresentValue> pPresentValue;
  6.         public static void main(String[] args)
  7.          {
  8.        
  9.         Annuity thisAnnnuity = new Annuity();
  10.         thisAnnnuity.setPayment();
  11.         thisAnnnuity.setTerm();
  12.         thisAnnnuity.setRate();
  13.         thisAnnnuity.setType();
  14.        
  15.    ArrayList<Annuity> pAnnuity = new ArrayList<Annuity>();
  16.        
  17.         int counter = 0;
  18.        
  19.         if(Annuity.getType = "0")
  20.        
  21.                 while(counter != thisAnnuity.getTerm())
  22.                 {
  23.                         counter++;
  24.                         thisAnnuity = new Annuity(counter, thisAnnuity.getPayment(), thisAnnuity.getRate(), thisAnnuity.getPVOFactor);
  25.                         pPresentValue.add(thisPresentValue);
  26.                         thisAnnuity.set(thisPresentValue.getPresentValue());
  27.                
  28.                 }
  29.        
  30.         if(Annuity.getType = "1")
  31.                 while(counter != thisAnnuity.getTerm())
  32.                 {
  33.                         counter++;
  34.                         thisAnnuity = new Annuity(counter, thisAnnuity.getPayment(), thisAnnuity.getRate(), thisAnnuity.getPVOFactor);
  35.                         pPresentValue.add(thisPresentValue);
  36.                         thisAnnuity.set(thisPresentValue.getPresentValue());
  37.                        
  38.                 }
  39.        
  40.         else
  41.         {
  42.                 System.err.println("Invalid Annuity Type: Please enter either 0 or 1");
  43.         }
  44.        
  45.         System.out.println("Annuity [Payment= " + pPayment + ",  Term= " + pTerm + ",  Rate= " + rate + ",  Type= " + pType + "]");
  46.         System.out.println("Present Value = $" + pPresentValue);
  47.         System.out.println("PV Factor = " + pPVOFactor);
  48.        
  49.        
  50.        
  51.        
  52.         }
clone this paste RAW Paste Data