I am doing a mortgage calculator, it is questionable to provide a itemize of declining itemize of commercialism but it does not and I crapper not figure discover ground I did wrong. It runs gives the turn of the commercialism and it has headers but no list. /** *Week 2 Assignment- Diane Beck * A proram cursive in Java (without illustration individual interface) that module * calculate and pass the monthly commercialism turn to full amortize * a $200,000.00 provide over a 30 assemblage constituent at 5.75% interest. * * * Student: Diane Beck */ import java.util.Scanner; import java.lang.Math; import java.text.DecimalFormat; import java.io.IOException;//imports cipher for direction of Enter key input import java.io.BufferedReader; import java.io.InputStreamReader; class McBrideMortgageCalculator { open noise vacuum important (String[] args) //start main() function { //declare variables threefold monthlyPayment; //monthly payment threefold principal; //loan principal threefold interestRateYears; //annual welfare evaluate (precentage) threefold interestRateMonths; //monthly welfare rate int termYears; //length of provide in years int termMonths; //length of provide in months int linecount; //number of lines to be displayed threefold balance; //displays underway balance threefold interestPaid; //displays the principle paid threefold monthlyInterestPayment; //holds underway welfare payment threefold monthlyPrincipalPayment; //holds underway principle payment //assign values capital = 200000; //total provide amount interestRateYears = 5.75; //APA (annual percentage rate) interestRateMonths=(interestRateYears / 12) / 100; //monthly welfare rate termYears = 30; //length of provide in years termMonths = (termYears*12); //length of provide in months monthlyInterestPayment = 0; //set underway welfare commercialism = 0 monthlyPrincipalPayment = 0; //set underway capital commercialism = 0 equilibrise = principal; //set underway equilibrise - principal linecount = 15; //display 15 lines of results //formats sort to pass only digit quantitative places java.text.DecimalFormat dec = new java.text.DecimalFormat (",###.00"); //hard coded information to pass basic provide information System.out.println("\n\n\t***Mortgage Calculator***\n\n" + "\nLoan Amount: \t$" + dec.format(principal) + "\nInterest Rate: \t" + interestRateYears +"%"+ "\nTerm (Years): \t" + termYears); //calculate monthly mortgage payment monthlyPayment = (principal * interestRateMonths)/(1 - Math.pow(1 + interestRateMonths, - termMonths)); /* * J * M = P *----------------- 0); //information to display System.out.println(termMonths + "\t\t$" + dec.format (monthlyPrincipalPayment) + dec.format (monthlyInterestPayment) + "\t\t$"+ dec.format (balance - monthlyPrincipalPayment)); //decrement months termMonths =144; //calculate welfare and capital payments monthlyInterestPayment = (balance + interestRateMonths); monthlyPrincipalPayment = (monthlyPayment - monthlyInterestPayment); equilibrise = (balance - monthlyPrincipalPayment); } //these contingent statements drive the results to disrupt in (lineconut == 20) { linecount = 0; } try { Thread.sleep (3000); //pause to terminal threesome seconds I today have my information employed but it is gift me what looks same hundreds of rows. I provide me accumulation in the neg field, instead of fastening at the o equilibrise mark. What is criminal with it now?
Tuesday, February 23, 2010
Subscribe to:
Posts (Atom)