PROGRAM_2

PROGRAM_2 - p=Console.nextInt(); System.out.println();

This preview shows pages 1–2. Sign up to view the full content.

import java.io.*; import java.text.*; import java.math.*; import java.lang.*; import java.util.Scanner; import java.util.*; //Jeremy Debruce //3/12/09 //Professor Campbell / public class PROGRAM_2 { public static void main(String[] args) { //variables double i,d1,m,t; int p,d; // purpose of the program System.out.println("****************************************************** *************"); System.out.println("*The Purpose of this program is to Compute the Monthly *"); System.out.println("*Payment for a changing principle loan with varying interest rates*"); System.out.println("* using Control Statements and output statements *"); System.out.println("* *"); System.out.println("****************************************************** *************"); System.out.println(); // Scanner Scanner Console = new Scanner(System.in); System.out.println("Please Enter the Principal Amount. ");

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: p=Console.nextInt(); System.out.println(); System.out.println(&quot;****************************************************** *&quot;); System.out.println(&quot;Principal Interest Duration Monthly Payment&quot;); System.out.println(&quot;****************************************************** *&quot;); System.out.print((p)); //Loop / for(i = 9.5; i &lt;= 12.5; i = i + .25) { //Interest Rate formatting if(i == 9.5) System.out.printf(&quot;%15.2f&quot;,i); else System.out.printf(&quot;%20.2f&quot;,i); for(d = 20; d &lt;= 30; d = d + 5)//Loop 2 { //Equations d1 = (i * .01) * (p / 12); t = 1 - (Math.pow((((i * .01) / 12) + 1),(-12 * d))); // Monthly Payment m= d1 / t; //Formatting if(d == 20) System.out.printf(&quot;%12s %17.2f %n&quot;, d, m); else System.out.printf(&quot;%32s %17.2f %n&quot;, d, m); } System.out.println(); } } }...
View Full Document

PROGRAM_2 - p=Console.nextInt(); System.out.println();

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online