Question: At first, the program shall obtain four user inputs: ( a ) property price , ( b ) loan ratio , ( c ) yearly

At first, the program shall obtain four user inputs: (a) property price ,(b) loan ratio ,(c) yearly
interest rate , and (d) number of years of the mortgage.
2. The above inputs are valid only if all the following conditions are met:
property price is positive; and
loan ratio is positive but at most 1; and
yearly interest rate is positive; and
number of years is positive.
In case any of the inputs is invalid, the program shall print a warning message and then
terminate.
3. Otherwise, the down payment , loan amount , and monthly payment shall be computed and
displayed.
4. Next, the program shall obtain one more user input: (e) the number of monthly payments made
.
5. This input is valid only if it is at least 0 but smaller than . In case this input is invalid, the
program shall print a warning message and then terminate.
6. Otherwise, the amount still owed and total interest paid after months shall be determined and
displayed.
You can assume that user inputs (a)(c) are always entered as floating point numbers and user
inputs (d)-(e) are always entered as integers. Therefore, you can use the double data type for
storing (a)-(c) and the int data type for storing (d)-(e).
When doing power calculations (
), you can use the C++ function pow(...,...). You must
#include at the top of your program before using it.
When printing the down payment, loan amount, monthly payment, amount still owed, and total
interest paid, the numbers shall be printed in fixed point notation (never scientific notation) and two
decimal places. This can be done by:
cout <<...<< fixed << setprecision(2)<< number_to_be_printed;
To use the above, you must #include at the top of your program.

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 Programming Questions!