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
- Be sure to look at the sample interaction below to help your understanding of these requirements
- Declare an integer: int score
- Declare the following chars: char discharged, bankruptcy
- Declare a double: double rate. Initialize this to 0.0
- Ask the user to enter their credit score. Receive the users input in score
- 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
- 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.
- If the user has had a bankruptcy and it has been not discharged show a message that the credit application is denied.
- 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:
- Check the users credit score. If their score is below 650, show a message that their application is denied.
- Using an if-else-if construct, and if their score is between 650 and 720, set rate to 3.5
- Continue the if-else-if construct and if their score is between 721 and 850, set rate to 1.9
- Finally, if the user has had a bankruptcy that has been discharged, add 3.0 to the current value of rate
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started