MonthlyPay

MonthlyPay - tiy = Integer.parseInt(t); rate /= 1200;

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.*; import java.lang.Math.*; public class MonthlyPay{ public static void main(String[] args){ String t; double temp; int pr , tiy; double mp , tp , ie , rate; t = JOptionPane.showInputDialog("Principle:"); pr = Integer.parseInt(t); t = JOptionPane.showInputDialog("Rate"); rate = Double.parseDouble(t); t = JOptionPane.showInputDialog("Term in years");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tiy = Integer.parseInt(t); rate /= 1200; System.out.println(rate); temp = java.lang.Math.pow((1+rate),(tiy * 12)); mp = ( rate + rate /( temp -1)) * pr; tp = mp * tiy * 12; ie = tp - pr; JOptionPane.showMessageDialog(null, "Monthly payment is:" + mp + "\nTotally Payment is:" + tp + "\nInterest Expense is:" + ie + "\n"); } }...
View Full Document

Ask a homework question - tutors are online