You work for an loan analytics organization have been tasked with writing a program that simulates an analysis of loan applications. Code a modular program that uses parallel arrays to store loan application credit scores (values generated between 300 and 900), score ratings (poor, fair, good, very good, or exceptional based on credit score) and loan status (approved or declined applications based on credit score). The program must do the following: The program must first ask the user for the number of loan applications that will be in the simulation. This must be done by calling the getNumLoanApplications() function (definition below). After the input of the number of accounts, the program must use loops and random numbers to generate the credit score, score rating, and application result for each loan application in parallel arrays. These arrays must not be declared globally (major error).  The following arrays must be declared and populated: creditScores[] - an array of type int that holds the credit score for the loan applications. The size of the array is determined by the number of loan applications the user entered in step 1. The values in this array represent the credit scores for each loan application. Credit scores for loan applications range from 300 - 900. scoreRatings[] - an array of type string to hold the credit score rating for the loan applications. The size of the array is determined by the number of loan applications the user entered in step 1. The values in the array represent the credit score rating for the loan application based on the credit score generated. In this simulation, credit scores can be one of the following: "poor" - Credit Score between 300 and 579 "fair" - Credit Score between 580 and 669 "good" - Credit Score between 670 and 739 "very good" - Credit Score between 740 and 799 "exceptional" - Credit Score between 800 and 900 loanStatuses[] - an array of type string to hold the status of each loan application. The size of the array is determined by the number of loan applications the user entered in step 1. The values in the array represent the status of each loan application based on the credit score generated. In this simulation, a loan application is "Approved" if the credit score generated is 630 or higher, otherwise the loan application is "Declined". Populate each of these arrays by using a loop that will execute based on the number of loan applications the user entered in step 1. On each pass, call the generateCreditScore function (definition below) to generate a loan application credit score and store in the creditScores[] array. Then, call the generateScoreRating() function (definition below) using the credit score generated to generate a score rating and store in the scoreRatings[] array. Finally, call the generateStatus() function (definition below) using the credit score generated to generate a loan status and store in the loanStatuses[] array. Once all of the arrays are populated, the program must display the result statistics of the simulation. This includes displaying the status, credit score and the credit score rating in each loan application along with total counts of loans approved, declined, and credit score rating category counts. This must be done by calling the analysis() (defined below) function that accepts all of the arrays as well as the number of loan applications generated and evaluated in the simulation the user entered in step 1. main(). In this simulation, credit scores can be one of the following: "poor" - Credit Score between 300 and 579 "fair" - Credit Score between 580 and 669 "good" - Credit Score between 670 and 739 "very good" - Credit Score between 740 and 799 "exceptional" - Credit Score between 800 and 900  instructions for this in picture  output be line  Enter the number of Loan Applications to be evaluated (min 50 - max 2000): 5000 Error : Invalid entry Enter the number of Loan Applications to be evaluated (min 50 - max 2000): -99 Error: Invalid entry Enter the number of Loan Applications to be evaluated (min 50 - max 2000): 1500 Application Status: Approved        Credit score: 745           Score rating: Very good  Application Status: Approved        Credit score: 639           Score rating:  good Application Status: Declined        Credit score: 200           Score rating: poor Application Status: Approved        Credit score: 800           Score rating: exceptional Application Status: Declined          Credit score: 544           Score rating: poor After 1500 rows  --------------------------------------------- Stats:- --------------------------------- Total Applications: 1500 Loans Approved:  700 Loans Declined: 800 ------------------------------------------ Total Score by rating: # "poor" - Credit Score between (300 - 579 ) 2  # "fair" - Credit Score between ( 580 - 669) 399 # "good" - Credit Score between (670 - 739) 299 # "very good" - Credit Score between (740 - 799) 186 # "exceptional" - Credit Score between (800 - 900) 2 ----------

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

You work for an loan analytics organization have been tasked with writing a program that simulates an analysis of loan applications.

Code a modular program that uses parallel arrays to store loan application credit scores (values generated between 300 and 900), score ratings (poor, fair, good, very good, or exceptional based on credit score) and loan status (approved or declined applications based on credit score).

The program must do the following:

  1. The program must first ask the user for the number of loan applications that will be in the simulation. This must be done by calling the getNumLoanApplications() function (definition below).
  2. After the input of the number of accounts, the program must use loops and random numbers to generate the credit score, score rating, and application result for each loan application in parallel arrays. These arrays must not be declared globally (major error)
  3. The following arrays must be declared and populated:
      • creditScores[] - an array of type int that holds the credit score for the loan applications. The size of the array is determined by the number of loan applications the user entered in step 1. The values in this array represent the credit scores for each loan application. Credit scores for loan applications range from 300 - 900.
      • scoreRatings[] - an array of type string to hold the credit score rating for the loan applications. The size of the array is determined by the number of loan applications the user entered in step 1. The values in the array represent the credit score rating for the loan application based on the credit score generated. In this simulation, credit scores can be one of the following:
        • "poor" - Credit Score between 300 and 579
        • "fair" - Credit Score between 580 and 669
        • "good" - Credit Score between 670 and 739
        • "very good" - Credit Score between 740 and 799
        • "exceptional" - Credit Score between 800 and 900
      • loanStatuses[] - an array of type string to hold the status of each loan application. The size of the array is determined by the number of loan applications the user entered in step 1. The values in the array represent the status of each loan application based on the credit score generated. In this simulation, a loan application is "Approved" if the credit score generated is 630 or higher, otherwise the loan application is "Declined".
      • Populate each of these arrays by using a loop that will execute based on the number of loan applications the user entered in step 1. On each pass, call the generateCreditScore function (definition below) to generate a loan application credit score and store in the creditScores[] array. Then, call the generateScoreRating() function (definition below) using the credit score generated to generate a score rating and store in the scoreRatings[] array. Finally, call the generateStatus() function (definition below) using the credit score generated to generate a loan status and store in the loanStatuses[] array.
  4. Once all of the arrays are populated, the program must display the result statistics of the simulation. This includes displaying the status, credit score and the credit score rating in each loan application along with total counts of loans approved, declined, and credit score rating category counts. This must be done by calling the analysis() (defined below) function that accepts all of the arrays as well as the number of loan applications generated and evaluated in the simulation the user entered in step 1.

main(). In this simulation, credit scores can be one of the following:

    • "poor" - Credit Score between 300 and 579
    • "fair" - Credit Score between 580 and 669
    • "good" - Credit Score between 670 and 739
    • "very good" - Credit Score between 740 and 799
    • "exceptional" - Credit Score between 800 and 900 
  • instructions for this in picture 

output be line 

Enter the number of Loan Applications to be evaluated (min 50 - max 2000): 5000

Error : Invalid entry

Enter the number of Loan Applications to be evaluated (min 50 - max 2000): -99

Error: Invalid entry

Enter the number of Loan Applications to be evaluated (min 50 - max 2000): 1500

Application Status: Approved        Credit score: 745           Score rating: Very good 

Application Status: Approved        Credit score: 639           Score rating:  good

Application Status: Declined        Credit score: 200           Score rating: poor

Application Status: Approved        Credit score: 800           Score rating: exceptional

Application Status: Declined          Credit score: 544           Score rating: poor

After 1500 rows 

---------------------------------------------

Stats:-

---------------------------------

Total Applications: 1500

Loans Approved:  700

Loans Declined: 800

------------------------------------------

Total Score by rating:

# "poor" - Credit Score between (300 - 579 ) 2 

# "fair" - Credit Score between ( 580 - 669) 399

# "good" - Credit Score between (670 - 739) 299

# "very good" - Credit Score between (740 - 799) 186

# "exceptional" - Credit Score between (800 - 900) 2

----------

 

 

Application Status: Declined Credit Score: 589
Application Status: Approved
Application Status: Declined
Application Status: Approved
Application Status: Declined
Application Status: Approved
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Approved
Application Status: Approved
Application Status: Approved
Application Status: Approved
Application Status: Declined
Application Status: Approved
Application Status: Declined
Application Status: Declined
Application Status: Approved
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Declined
Application Status: Approved
Application Status: Approved
Application Status: Approved
Application Status: Declined
Credit Score: 648
Credit Score: 382
Credit Score: 753
Credit Score: 374
Credit Score: 720
Credit Score: 302
Credit Score: 623
Credit Score: 531
Credit Score: 469
Credit Score: 578
Credit Score: 759
Credit Score: 708
Credit Score: 719
Credit Score: $71
Credit Score: 303
Credit Score: 645
Credit Score: 481
Credit Score: 404
Credit Score: 692
Credit Score: 585
Credit Score: 413
Credit Score: 398
Credit Score: 489
Credit Score: 422
Credit Score: $38
Credit Score: 737
Credit Score: 710
Credit Score: 561
Score Rating: foir
Score Rating: foir
Score Rating: poor
Score Rating: very good
Score Rating: poor
Score Rating: Rood
Score Rating: poor
Score Rating: foir
Score Rating: poor
Score Rating: poor
Score Rating: poor
Score Rating: very good
Score Rating: Rood
Score Rating: Rood
Score Rating: exceptional
Score Rating: poor
Score Rating: foir
Score Rating: poor
Score Rating: poor
Score Rating: good
Score Rating: fair
Score Rating: poor
Score Rating: poor
Score Rating: poor
Score Rating: poor
Score Rating: exceptional
Score Rating: good
Score Rating: good
Score Rating: poor
Transcribed Image Text:Application Status: Declined Credit Score: 589 Application Status: Approved Application Status: Declined Application Status: Approved Application Status: Declined Application Status: Approved Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Approved Application Status: Approved Application Status: Approved Application Status: Approved Application Status: Declined Application Status: Approved Application Status: Declined Application Status: Declined Application Status: Approved Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Declined Application Status: Approved Application Status: Approved Application Status: Approved Application Status: Declined Credit Score: 648 Credit Score: 382 Credit Score: 753 Credit Score: 374 Credit Score: 720 Credit Score: 302 Credit Score: 623 Credit Score: 531 Credit Score: 469 Credit Score: 578 Credit Score: 759 Credit Score: 708 Credit Score: 719 Credit Score: $71 Credit Score: 303 Credit Score: 645 Credit Score: 481 Credit Score: 404 Credit Score: 692 Credit Score: 585 Credit Score: 413 Credit Score: 398 Credit Score: 489 Credit Score: 422 Credit Score: $38 Credit Score: 737 Credit Score: 710 Credit Score: 561 Score Rating: foir Score Rating: foir Score Rating: poor Score Rating: very good Score Rating: poor Score Rating: Rood Score Rating: poor Score Rating: foir Score Rating: poor Score Rating: poor Score Rating: poor Score Rating: very good Score Rating: Rood Score Rating: Rood Score Rating: exceptional Score Rating: poor Score Rating: foir Score Rating: poor Score Rating: poor Score Rating: good Score Rating: fair Score Rating: poor Score Rating: poor Score Rating: poor Score Rating: poor Score Rating: exceptional Score Rating: good Score Rating: good Score Rating: poor
Application Status: Approved
Application Status: Declined
Application Status: Approved
Application Status: Approved
Application Status: Declined
Application Status: Declined
Application Status: Approved
Application Status: Approved
Application Status: Approved
Application Status: Declined
Application Status: Declined
Application Status: Approved
Application Status: Declined
Stats:
Total Applications:
1505
Loans Approved: 692
Loans Declined: 813
Total Scores By Rating:
Credit Score: 822
Credit Score: 311
Credit Score: 719
Credit Score: 861
Credit Score: 556
Credit Score: 590
Credit Score: 863
Credit Score: 783
Credit Score: 816
Credit Score: 432
Credit Score: 552
Credit Score: 641
Credit Score: 454
# of Poor Scores (300
579): 700
# of Fair Scores (580 669): 215
# of Good Scores (670- 739): 183
# of Very Good Scores (740 - 799): 155
# of Exceptional Scores (800 - 900): 252
Process exited after 62.22 seconds with return value 0
Press any key to continue
Score Rating: exceptional
Score Rating: poor
Score Rating: good
Score Rating: exceptional
Score Rating: poor
Score Rating: fair
Score Rating: exceptional
Score Rating: very good
Score Rating: exceptional
Score Rating: poor
Score Rating: poor
Score Rating: fair
Score Rating: poor
Transcribed Image Text:Application Status: Approved Application Status: Declined Application Status: Approved Application Status: Approved Application Status: Declined Application Status: Declined Application Status: Approved Application Status: Approved Application Status: Approved Application Status: Declined Application Status: Declined Application Status: Approved Application Status: Declined Stats: Total Applications: 1505 Loans Approved: 692 Loans Declined: 813 Total Scores By Rating: Credit Score: 822 Credit Score: 311 Credit Score: 719 Credit Score: 861 Credit Score: 556 Credit Score: 590 Credit Score: 863 Credit Score: 783 Credit Score: 816 Credit Score: 432 Credit Score: 552 Credit Score: 641 Credit Score: 454 # of Poor Scores (300 579): 700 # of Fair Scores (580 669): 215 # of Good Scores (670- 739): 183 # of Very Good Scores (740 - 799): 155 # of Exceptional Scores (800 - 900): 252 Process exited after 62.22 seconds with return value 0 Press any key to continue Score Rating: exceptional Score Rating: poor Score Rating: good Score Rating: exceptional Score Rating: poor Score Rating: fair Score Rating: exceptional Score Rating: very good Score Rating: exceptional Score Rating: poor Score Rating: poor Score Rating: fair Score Rating: poor
Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Introduction to Template
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
  • SEE MORE 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