How to create mortgage code in Java?

Design and implement a program that calculates and displays the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. In first iteration of the program, hard code the principal equals 200,000 dollars, the term equals 30 years, and the annual interest rate equals 5.75 percent.

2010-11-07T22:34:01Z

/*
Title: Mortgage
Description: This program will calculate the mortgage:
- Amount
- Terms
- Interest
- use methods
Author:
Date: 11/07/2010
Version: 1.0


*/
//importing java packages
import java.text.DecimalFormat;

//class declaration
public class mortgage
{

//Main method
//Every Java program must have this
public static void main(String args[])
{

// Declare and construct variables
double interest,payment;
int ammount,term;
DecimalFormat decimalPlaces=new DecimalFormat("0.00");

/*Below is the hard coded values used to calculate the
monthly mortgage payment. */
interest=.0475; //The interest percentage is 4.75%.
ammount=400000; //The principle of the loan is $400,000.
term=30; //The term of the loan is 30 years.

// This is the formula ued
payment=(ammount*((interest/12)/(1-Ma

?2010-11-07T21:57:45Z

Favorite Answer

Yahoo answers isn't your human coding machine.