ReviewEssays.com - Term Papers, Book Reports, Research Papers and College Essays
Search

Mortgage Calc

Essay by   •  February 16, 2011  •  Essay  •  308 Words (2 Pages)  •  910 Views

Essay Preview: Mortgage Calc

Report this essay
Page 1 of 2

/*

Application Financial Mortgage Calculator

Date

Filename Mortgage_app.java

Created by

Revision

*/

import java.io.*;

import java.text.DecimalFormat;

//Setup new class

class Mortgage_app

{

public static void main(String[] args)

{

//declarations (array format)

double[][] d_Input = {{0.0535, 0.0550, 0.0575},{7, 15, 30}};

//setup data pass to class Mortgage_calc_app

Mortgage_calc_app calc1 = new Mortgage_calc_app();

Mortgage_calc_app calc2 = new Mortgage_calc_app();

Mortgage_calc_app calc3 = new Mortgage_calc_app();

calc1.setd_Rate(d_Input[0][0]);

calc1.seti_Term(d_Input[1][0]);

calc1.printStates();

calc2.setd_Rate(d_Input[0][1]);

calc2.seti_Term(d_Input[1][1]);

calc2.printStates();

calc3.setd_Rate(d_Input[0][2]);

calc3.seti_Term(d_Input[1][2]);

calc3.printStates();

}

}

//reuse initial class

class Mortgage_calc_app

{

//decimal format

DecimalFormat Currency = new DecimalFormat("$0.00");

DecimalFormat Count = new DecimalFormat("0");

//declarations

double d_Rate,d_Loan,d_Amount,d_intPay,d_Principal;

double i_Term,i_Count,i_Count2,i_Line;

//pull data from class Mortgage_app

void setd_Rate(double newValue)

{

d_Rate = newValue;

}

void seti_Term(double newValue)

{

i_Term = newValue;

}

void printStates()

{

//initialize declarations

d_Loan = 200000;

i_Count = 0;

i_Line = 0;

//calculation for the monthly payment

d_Amount = (d_Loan*((d_Rate/12)/(1-Math.pow((1+(d_Rate/12)),-(i_Term*12)))));

//output to standard IO

System.out.println("nttttAMORTIZATION TABLEnn");

System.out.println("n#tPaymentttBalancettPaid

...

...

Download as:   txt (3 Kb)   pdf (67.2 Kb)   docx (10.1 Kb)  
Continue for 1 more page »
Only available on ReviewEssays.com