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

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

View Full Document Right Arrow Icon
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. ");
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
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("****************************************************** *"); System.out.println("Principal Interest Duration Monthly Payment"); System.out.println("****************************************************** *"); System.out.print((p)); //Loop / for(i = 9.5; i <= 12.5; i = i + .25) { //Interest Rate formatting if(i == 9.5) System.out.printf("%15.2f",i); else System.out.printf("%20.2f",i); for(d = 20; d <= 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("%12s %17.2f %n", d, m); else System.out.printf("%32s %17.2f %n", d, m); } System.out.println(); } } }...
View Full Document

Page1 / 2

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 Right Arrow Icon
Ask a homework question - tutors are online