PROGRAM_TWO

# PROGRAM_TWO -...

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_TWO { public static void main(String[] args) { //variables double i,d1,m,t; int p,d; NumberFormat currency=NumberFormat.getCurrencyInstance(); // 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(); System.out.println();

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: System.out.println(&quot;****************************************************** ******&quot;); System.out.println(&quot;Principal Interest Duration Monthly Payment&quot;); System.out.println(&quot;****************************************************** ******&quot;); * //Loop / for (p=50000; p&lt;=100000;p=p+10000) { System.out.print(currency.format(p)); 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;%25.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;%10s %17.2f %n&quot;, d, m); else System.out.printf(&quot;%35s %17.2f %n&quot;, d, m); } System.out.println(); } } } }...
View Full Document

## PROGRAM_TWO -...

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

View Full Document
Ask a homework question - tutors are online