Mortgage Calculator Program

942 Words2 Pages

Write program that will calculate monthly payment for a mortgage.

Get Variables, Principle, Rate and Interest, Term, Monthly Interest

Figure out monthly interest

Figure out number of months

Finally you need to calculate the monthly payment

Display the monthly payment for the mortgage

class Mort //Translated into English, this line means, "Computer, give my Java program the name Mort.

{

public static void main(String[]arguments) //This line tells the computer, "The main part of the program begins here." Java programs

//are organized into different sections, so there needs to be a way to identify the part of a program that will be handled first.

//The main statement is the entry point to almost all Java programs. The exception are applets, programs that are run in conjunction with a World Wide Web page.

//Most of the programs you will write during the next several hours use main as the starting point.

{ //These brackets are a way to group parts of your program (in the same way that parentheses are used in a sentence to group words).

//Everything between the opening bracket, {, and the closing bracket, }, is part of the same group. These groupings are called blocks.

//This line is a placeholder. The // at the beginning of the line tells the computer to ignore this line—it is put in the program

//solely for the benefit of humans who are looking at the program's text. Lines that serve this purpose are called comments.

//You can do this by using a variable, a storage place that can hold information such as integers, floating-point numbers, true-false values,

//characters, and lines of text. The information stored in a variable can change, which is where the name "variable" comes from.

double Principle; //Mortgage Amount

double Interest; // Interest on Mortgage

double Months; // How many months to pay off mortgage

double MonthlyInterest; // Monthly interest

Open Document