Related Articles

More

Related Categories

More

Recently Added

More

Mortgage Calculator Rates

Joan Said:

Java Mortgage calculator help.?

We Answered:

import java.util.Scanner;

class MortgageCalculator2 {

public MortgageCalculator2() {
intro();
}

public void mess(String s) {
System.out.printf("%s%n", s);
}

public void messIn(String s) {
System.out.printf("%s > ", s);
}

public void intro() {
Scanner sc = new Scanner(System.in);
boolean run = true;

mess("----------------------------------…
mess("Mort Especiu00e2l Waresofto");
mess("if we can't float the loan, the gov't will");
mess("----------------------------------…
while (run) {
String[] args = new String[3];
messIn("enter Principal Amount: ");
args[0] = sc.nextLine();
messIn("enter Note Period (Years)");
args[1] = sc.nextLine();
messIn("enter APR example: 9.55");
args[2] = sc.nextLine();
String pmt = calculation(args);
mess("n");
mess(pmt);
mess("do another one?");
if (sc.nextLine().
equalsIgnoreCase("q")) {
run = false;
}
}
}

public static void main(String[] args) throws Exception {
new MortgageCalculator2();

}

private String calculation(String[] args) {
float pv = Float.valueOf(args[0]);
int term = Integer.valueOf(args[1]);
float apr = Float.valueOf(args[2]);
// double ir = apr / 100 / 12;
double ir = apr / 12 ;
double np = term *12;
System.out.printf("interest monthly: %2.2f%%", ir);
double payNum = (pv * ir) / ( 1 - (1+ir)-np);
return String.format( "Monthly Payment: $%6.2f",payNum);
}
}

I don't have faith in the teacher's formula. This is not how I would do a mortgage program. But, maybe this will get you going.

Emma Said:

Mortgage Calculator Help?

We Answered:

you can type how to calculate money into yahoo and pick out the right formula and plug in the numbers and solve for periods!!!

Barry Said:

How can I add real estate tools to my website?

We Answered:

Try this tool. I hope this helps,

Discuss It!