Question: *********************C++ program*********************** ( I have tried to write this code in c++ atleast 10 and I cant get the outputs to print correctly) The purpose

*********************C++ program***********************

( I have tried to write this code in c++ atleast 10 and I cant get the outputs to print correctly)

The purpose of this challenge is to use the IF, IF-ELSE-IF and nested IF statements to control program flow. This simulates the credit underwriting process for a loan.

Requirements

  1. Be sure to look at the sample interaction below to help your understanding of these requirements
  2. Declare an integer: int score
  3. Declare the following chars: char discharged, bankruptcy
  4. Declare a double: double rate. Initialize this to 0.0
  5. Ask the user to enter their credit score. Receive the users input in score
  6. Ask the user if they have had a bankruptcy. Receive the users input as either a y or an n; use the bankruptcy variable to store this input
  7. Using a nested if statement, if the user responds that they have had a bankruptcy, ask if the bankruptcy has been discharged. Similarly, receive the users input as either a y or an n; use the discharged variable to store this input.
  8. If the user has had a bankruptcy and it has been not discharged show a message that the credit application is denied.
  9. If, however, the user has not had a bankruptcy, or the user had a bankruptcy and it has been discharged then write a nested if statement as below:
    1. Check the users credit score. If their score is below 650, show a message that their application is denied.
    2. Using an if-else-if construct, and if their score is between 650 and 720, set rate to 3.5
    3. Continue the if-else-if construct and if their score is between 721 and 850, set rate to 1.9
    4. Finally, if the user has had a bankruptcy that has been discharged, add 3.0 to the current value of rate
  10. If upon determining that the application was approved, display to the user a congratulatory message with their final interest rate.

example of outputs

_________________________________________________

-- Thank you for applying for our loan -- What is your credit score? 720 Have you had a bankruptcy? n Your application has been APPROVED! Your rate is 3.5%

________________________________________________________

-- Thank you for applying for our loan -- What is your credit score? 580 Have you had a bankruptcy? n Unfortunately, your application has been denied. You may apply again in 6 months.

___________________________________________________

-- Thank you for applying for our loan -- What is your credit score? 720 Have you had a bankruptcy? y Has your bankruptcy been discharged? y Your application has been APPROVED! Your rate is 6.5%

____________________________________________________________

-- Thank you for applying for our loan -- What is your credit score? 640 Have you had a bankruptcy? y Has your bankruptcy been discharged? n Unfortunately, your application has been denied. You may apply again in 6 months.

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!