Question: 3 . fr Analyze Mortgage [ ESE | ) | Amount of loan: 2 4 0 0 0 0 Interest rate: ( suchas 5 .

3.
fr Analyze Mortgage [ESE
|
)
|
Amount of loan: 240000
Interest rate:
(suchas 5.25)
6
Duration in months: 360
Monthly payment:
|
FIGURE 4.22
Total interest paid:
En
i
~~
~~
$1.438.92
$278,011.65
1]
)
Possible output for Practice Problem 3.
Write a program to analyze a mortgage. See Fig. 4.22. The user should enter the amount of
the
loan, the annual percentage 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 it is reasonable. If bad dara have been supplied, the user should be so advised.
Otherwise, the monthly payment and the total amount of interest paid should be displayed.
The formula for the monthly payment is
payment = p*5/(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 pb.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!