Determining the monthly payment on a mortgage loan, C/C++ Programming

The following is the formula that can be used to complete that calculation:

Monthly Payment =

Monthly Interest Rate / (1 - (1 + Monthly Interest Rate) -Payment Interval)) * Principal

Where

Monthly Interest Rate expressed as: Interest Rate / 100 / 12.

Payment Interval expressed as: Number of Years * Months of Year.

Principal is total amount of mortgage expressed without any comma separators or $ prefixing it.

An example for the above formula:

Rate: 7.75

Period: 360

Principal: $100,000

(7.75 / 100 /12) / (1 - (1 + 7.75 /100 / 12) ^ -(30 * 12) ) * 100000

The result of the above formula generates a value of 682.18. (Note that there is no formatting of the value.) The ^ is the symbol for an exponent that replaces the superscript in an actual formula.

In C++ you must declare variables for the rate, period, principal, and monthly payment. Each of these variables is prefixed with a data type. In this case the data types are limited to float for decimal-based numbers (interest rate and monthly payment) and int for whole numbers (payment interval and principal). NOTE: C++ in case sensitive so be sure the variable is the same in every instance.

Some of the Code:

          Payment = ?? / (1 - pow((1 + ??), - ?? * 12))  * ??;

          cout << "Your monthly mortgage payment is $" << ?? << endl  << endl;

[Remember to have #include

Test:

Rate

Period

Principal

Monthly Payment

3.50%

30 years

$350,000.00

1571.656

6.25%

15 years

$275,000.00

2357.913

7.325%

30 years

$468,000.00

3216.427*

5.50%

40 years

$725,000.00

3739.335

8.125%

30 years

$645,000.00

4789.107*

*Possible rounding error

Posted Date: 4/1/2013 3:26:39 AM | Location : United States







Related Discussions:- Determining the monthly payment on a mortgage loan, Assignment Help, Ask Question on Determining the monthly payment on a mortgage loan, Get Answer, Expert's Help, Determining the monthly payment on a mortgage loan Discussions

Write discussion on Determining the monthly payment on a mortgage loan
Your posts are moderated
Related Questions
Public, Private and Protected members: Class members can either be declared in public','protected' or in the 'private' sections of the class. But as one of the features of OOP i

Write a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '

how we write decision tables, flowcharts,pseudocode,and algorithm in result management system

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

I want a Reverse engineer a .exe to obtain the code Project Description: I'd like to get the full C++ source code from a .exe please Skills required is C++ Programming

Explain the Bit Wise Operations? C language in particular was created to make it easier to write operating systems. The objective was to have a language that provided excellent

write an algorithm that reads a postive integer n and then finds and prints the sum of all integers between 1 and n (inclusive) that are disvisible by 7. please write this using c

C program to reverse the elements of array: #define rows 3 #define cols 3 void main() {                 int i=0,j=0;                 int arr[rows][cols];