Mortgage Calc

Below is one of our free research papers on Mortgage Calc. If the term paper below is not exactly what you're looking for, you can search our essay database for other topics or order a custom essay.

Mortgage Calc

/*
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("\n\t\t\t\tAMORTIZATION TABLE\n\n");

System.out.println("\n#\tPayment\t\tBalance\t\tPaid Interest\tPrincipal");

//while loan is greater than 1 penny loop

while (d_Loan > 0.01)
{

//application hesitation

if...
  • Submitted by: momojojo79
  • Date Submitted: 04/14/2008 06:39 PM
  • Category: Technology
  • Words: 357
  • Pages: 2
  • Views: 496
  • Rank: 44562

Saved Papers

Save papers so you can find them more easily!

Join Now

Get instant access to over 180,000 papers.

Join Now