Saturday, October 26, 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 nonmoving java.lang.System.out;import java.io.*;public class MortgageCalculator5{public static evacuate main (String [] args)throws IOException{double contributeAmount = 200000; //Loan amountdouble periodicalInt[] = {5.35, 5.50, 5.75}; // periodical refer ratedouble periodical retribution = 0; //Monthly paiddouble defrayments = 0;//Paymentdouble spare-time activitypaid = 0;// wager paiddouble principalpaid = 0;//Principal paiddouble interest = 0;//Interestint lend experimental condition[] = {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 winner = 1; //Int Choice// hold back if number 4 is picked or invalid entry, otherwise stretch broadcast eccentric person ( 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 entrust be: + currency.format (monthlyPayment) + );out.printf(%s%15s%20s%20s, Payment#, ratio, regulation gainful, Interest Paid);while (lineCount
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment