Explore BrainMass
Share

# Write a Visual Basic 2010 program to analyze a mortgage.

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Write a Visual Basic 2010 program to analyze a mortgage. The user should enter the amount of the loan, the annual rate of interest, and the duration of the loan in months. When the user clicks on the button, the information that was entered should be checked to make sure that it is reasonable. If bad data have been supplied, the user should be advised about it. Otherwise, the monthly payment and the total amount of interest paid should be displayed.

The formula for the monthly payment is

payment =p*r/(1-(1+r)^(-n))

where p is the amount of the loan, r is the monthly interest rate (annual rate divided by 12) given as a number between 0 (for 0 percent) and 1 (for 100 percent), and n is the duration of the loan in months.

The formula for the total interest paid is

total interest =n*payment -p.

Test the program for a mortgage of \$240,000 at 6% annual rate of interest, and duration 360 months. Such a mortgage will have a monthly payment of \$1,438.92 and total interest of \$278,011.65.

© BrainMass Inc. brainmass.com March 21, 2019, 10:06 pm ad1c9bdddf
https://brainmass.com/computer-science/visual-basic/write-visual-basic-program-analyze-mortgage-405076

#### Solution Summary

The expert writes a Visual Basic 2010 program to analyze a mortgage.

\$2.19