.

Tuesday, February 11, 2014

Mortgage Calculator week 5 Java II

/*Programmer:SkySharkFile:MortgageCalculator5.javaDate:June 23,2008Purpose:To calculate and display the mortgage of the hard coded terms- 7 year at 5.35%- 15 year at 5.5%- 30 year at 5.75%*/ spell out java.text.NumberFormat; //for currency formatimport java.util.*; //for Scannerimport stable java.lang.System.out;import java.io.*;public class MortgageCalculator5{public static keep off main (String [] args)throws IOException{double contributeAmount = 200000; //Loan amountdouble periodicalInt[] = {5.35, 5.50, 5.75}; // periodical refer ratedouble periodic retribution = 0; //Monthly paiddouble defrayments = 0;//Paymentdouble spare-time activitypaid = 0;// saki paiddouble principalpaid = 0;//Principal paiddouble interest = 0;//Interestint loanword term[] = {7, 15, 30}; //Term in year, arrayint contrastCount = 1;// Int line countNumberFormat currency = NumberFormat.getCurrencyInstance (); //for currency formatScanner sc = new Scanner(System.i n); //for reading in a value from the mentionboardint blue-ribbon(prenominal) = 1; //Int Choice// hold back if number 4 is picked or invalid entry, otherwise stretch broadcast flake ( election != 4 ) //start loop for choice 4{do {if (choice > 4 || choice 4 );if ( choice != 4 ){switch (choice) { // branch to an appropriate selectioncase 1:loanAmount = 200000.00; // reset loan amountlineCount = 1; //reset line countmonthlyPayment = calculate(loanAmount, monthlyInt[0], loanTerm[0]) ;out.println(Your monthly payment bequeath be: + currency.format (monthlyPayment) + );out.printf(%s%15s%20s%20s, Payment#, counterpoise, regulation gainful, Interest Paid);while (lineCount

No comments:

Post a Comment