Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Create a mortgage calculator that takes as input the principal loan amountinterest ratemonthly payment and 

Create a mortgage calculator that takes as input the principal loan amountinterest ratemonthly payment and 

Computer Science

Create a mortgage calculator that takes as input the principal loan amountinterest ratemonthly payment and . As output, your calculator should generate an amortization table, and compute how many years and months it took to pay off the mortgage, and report the total amount of payments over that time.

Things to consider when implementing the calculator

For dollar values, only display two digits of precision after the decimal point.

You can assume that the bank will not round internally!

You must not round internally either!)

The final payment will almost certainly be smaller than the others, so be careful to check for that case so you don't end up with a negative balance. The final balance must be 0.

If the monthly payment is too small, the balance will go up every month!

If this happens, the program should stop and display an appropriate error message.

Manually stopping your code in this case is not considered a solution -- your submitted code must detect the problem itself, and not enter an infinite loop.

If you accidentally create an infinite loop during development and testing, interrupt or restart the kernel. See the Kernel menu up top.

Use the modulus or %% operator to separate the years and months.

Your program should only display the columns requested, and the rows should be formatted to appear under the appropriate heading.

 

Example of schedule:

 

month     payment     interest     balance    
1          500          416.67      99916.67
2          500          416.32      99832.99
3          500          415.97      99748.96
4          500          415.62      99664.58
5          500          415.27      99579.85
6          500          414.92      99494.76
7          500          414.56      99409.32
8          500          414.21      99323.53
9          500          413.85      99237.38
10         500          413.49      99150.87

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE