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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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!

 

 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education