Write a C++ program that will ask the user to input the following: total monthly income, total monthly expenses, preferred model house (A,B or C) and mode of payment (C –cash or I – installment). Validate the input – monthly income and expenses must be a positive value, model house and mode of payment are characters. If at least one data is invalid do not process and display an error message before ending the program Please refer to the table below to see if the loan will be granted or not and how much will a customer pay if mode of payment is Cash.
Write a C++ program that will ask the user to input the following:
- total monthly income,
- total monthly expenses,
- preferred model house (A,B or C) and
- mode of payment (C –cash or I – installment).
Validate the input – monthly income and expenses must be a positive value, model house and mode of payment are characters. If at least one data is invalid do not process and display an error message before ending the program
Please refer to the table below to see if the loan will be granted or not and how much will a customer pay if mode of payment is Cash.
House Model Total Contract Price Down Payment Monthly Amortization
A 3,563,890.00 30% of TCP 25,789.00
B 2,678,400.00 20% of TCP 20,675.00
C 1,980,700.00 15% of TCP 18,763.00
For a loan to be granted monthly amortization must be less than (total monthly income minus total monthly expenses). A 5% discount from the TCP (Total Contract Price) is given if mode of payment is cash.
Example:
Total Monthly Income: 156,900.00
Total Monthly Expenses: 113,560.00
House Model (A, B or C): A
Mode of Payment (C or I): C
Total Contract Price: 3,563,890.00
Discount: 178,194.50
Balance: 3,385,695.50
--------------------------------------------
Total Monthly Income: 156,900.00
Total Monthly Expenses: 113,560.00
House Model (A, B or C): A
Mode of Payment (C or I): I
Total Contract Price: 3,563,890.00
Down Payment: 1,069,167.00
Monthly Amortization: 25,789.00
LOAN APPROVED! Congratulation!
--------------------------------------------
Total Monthly Income: 156,900.00
Total Monthly Expenses: 136,450.00
House Model (A, B or C): A
Mode of Payment (C or I): I
Total Contract Price: 3,563,890.00
Down Payment: 1,069,167.00
Monthly Amortization: 25,789.00
Sorry LOAN DENIED!
Step by step
Solved in 3 steps