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

Assignment Help:

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


Related Discussions:- Determining the monthly payment on a mortgage loan

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Structured design of programs, Within software engineering, software is ver...

Within software engineering, software is very rarely written by a single software engineer. Usually a team of engineers write a program; therefore a formal structural design approa

What is a union how does it differ from a structure, Question : (a) (i)...

Question : (a) (i) What is a structure member in C? What is the relationship between a structure member and the structure? (ii) How can structure variables be declared in C?

Playback pattern sequences, This task involves creating a new class(es) tha...

This task involves creating a new class(es) that will allow the system to playback pattern sequences using the Neo  Freerunner  hardware. The first thing to note is that the vibrat

2, how to do 2, 4, 8 associativity

how to do 2, 4, 8 associativity

I want to change c++ code to python extension, I want to change C++ code to...

I want to change C++ code to Python extension Project Description: I have the C++ source code for an executable that takes a path to an image file as the input and prints tex

MINIMUM SHELVES, Write a program to find minimum number of shelves

Write a program to find minimum number of shelves

Area under the curve, Write a program to find the area under the curve y = ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Program for single int parameter, Write a function that has a single int pa...

Write a function that has a single int parameter n and returns an int: 0 if n is negative, otherwise 1. You are not allowed to simply check the integer value, and should use the fu

In which condition a template a better solution than a base , In which cond...

In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd