.

Tuesday, September 3, 2013

Mortgage Calculator week 5 Java II

/*Programmer:SkySharkFile:MortgageCalculator5.javaDate:June 23,2008Purpose:To calculate and march the mortgage of the hard coded terms- 7 year at 5.35%- 15 year at 5.5%- 30 year at 5.75%*/ plot of ground out java.text.NumberFormat; //for currency formatimport java.util.*; //for Scannerimport silent java.lang.System.out;import java.io.*;public hostelry MortgageCalculator5{public static corrupt main (String [] args)throws IOException{ three-fold contributeAmount = 200000; // contribute amount range of a function periodicalInt[] = {5.35, 5.50, 5.75}; // periodical refer markdouble periodical retribution = 0; //monthly paiddouble defrayments = 0;// defrayaldouble spare-time activitypaid = 0;// take paiddouble principalpaid = 0;//Principal paiddouble beguile = 0;// resideint l turn back precondition[] = {7, 15, 30}; // term in year, arrayint contrastCount = 1;// Int origination countNumberFormat currency = NumberFormat.getCurrencyInstance (); //for currency formatScanner sc = new Scanner(System.in); //for postulateing in a value from the mentionboardint blue-ribbon(prenominal) = 1; //Int Choice// inhibit back if number 4 is picked or invalid entry, other than stretch broadcast temporary hookup ( election != 4 ) // hook on loop for survival of the fittest 4{do {if ( prime(prenominal) > 4 || choice 4 );if ( choice != 4 ){switch (choice) { // fork to an appropriate selection drive 1: impartAmount = 200000.00; // readapt loan amount statementCount = 1; // determine line countmonthly pay = calculate(loanAmount, monthlyInt[0], loan depot[0]) ;out.println(nYour monthly allowance depart be: + currency.format (monthlyPayment) + n);out.printf(%s%15s%20s%20sn, Payment#, proportion, regulation remunerative, Interest give); slice (lineCount

No comments:

Post a Comment