Sunday, December 29, 2013
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 tranquil java.lang.System.out;import java.io.*;public class MortgageCalculator5{public static forfend main (String [] args)throws IOException{double contributeAmount = 200000; //Loan amountdouble periodicalInt[] = {5.35, 5.50, 5.75}; // periodical refer ratedouble monthly retribution = 0; //Monthly paiddouble defrayments = 0;//Paymentdouble spare-time activitypaid = 0;// touch on paiddouble principalpaid = 0;//Principal paiddouble interest = 0;//Interestint lend marge[] = {7, 15, 30}; //Term in year, arrayint contrastCount = 1;// Int line countNumberFormat currency = NumberFormat.getCurrencyInstance (); //for currency formatScanner sc = new Scanner(System. in); //for reading in a value from the mentionboardint boss = 1; //Int Choice// hold back if number 4 is picked or invalid entry, otherwise stretch broadcast point ( 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 go away be: + currency.format (monthlyPayment) + );out.printf(%s%15s%20s%20s, Payment#, equalizer, regulation gainful, Interest Paid);while (lineCount
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment