Concept explainers
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
----------
Step by stepSolved in 5 steps with 4 images
- Campground reservations, part 3: Available campsites Excellent job! This next one's a little more challenging. Which campsites are available to reserve? We want to be able to quickly find which campsites are available. Can you help us? Given a campgrounds array, return an array with the campsite numbers of all currently unreserved (isReserved === false) campsites. Call the function availableCampsites. Dataset As a reminder, our data looks like this. It's an array with a bunch of campsite objects in it. Here is a small subset of the data to give you an idea: const campgrounds = [ { number: 1, view: "ocean", partySize: 8, isReserved: false }, { number: 5, view: "ocean", partySize: 4, isReserved: false }, { number: 12, view: "ocean", partySize: 4, isReserved: true }, { number: 18, view: "forest", partySize: 4, isReserved: false }, { number: 23, view: "forest", partySize: 4, isReserved: true }, ];arrow_forwardWrite a program that determines how many terms 10 students need to graduate. Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. Place the algorithm in a Word document. Step 2. Code the program in Eclipse and ensure the following steps are accomplished. Define a two-dimension array with 10 rows and 2 columns. Prompt the user to enter the number of courses they have left to graduate (value must be between 1 and 20) and how many courses they plan to take each term (value must be between 1 and 5). If the user enters either value out of range then the user must be prompted to reenter. The program must store the number of courses a student has left and how many courses they plan to take each term in a different row of the array, i.e. the first student’s number of courses and how many they plan to take each term will be stored in first row of array. The second student’s info will be in second row, and so on. The program must compute the…arrow_forwardYou can Use C++ programming, Windows Programming, Java, or Ptyhon to solve it The following table contains quarterly sales figures for five (5) departments: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Total Department 1 750 660 910 800 Department 2 800 700 950 900 Department 3 700 600 750 600 Department 4 850 800 1000 950 Department 5 900 800 960 980 Total Design and write a Windows program/module named SalesAnalysis that will: Declare a two-dimensional integer array named sales – (Note: you have 6 rows and 5 columns) - that will hold the 4 quarterly sales for 5 departments Populate the first four columns for the 5 departments using the data in the preceding table. Contain a loop to compute and populate the total column. Store each department’s total in the array as it is being computed. Contain a loop to compute and populate the total row. Store each quarter’s total in the array as it is…arrow_forward
- For questions 1-4, assume values is an int array that is currently filled to capacity, with the following values: 1) What is returned by values[3]? a) 9b) 12c) 2d) 6e) 3arrow_forwardUsing the data file below design a hierarchical struct to organize the data. Then declare an array of structs for the reservations. The data file contains ten reservations. There are 8 columns of data: party name, size, date and time for the reservation, phone number, email address, credit card number and expiration date for the credit card. The data can be read from the file below so you will not need to type it in repeatedly. Once you have populated the array with data perform the following tasks: Write a function that will print out to the screen the information for one reservation.In the main program write code that prompts the user to enter a date in the form MM DD YYYYCall the function to print out all reservations on that date. You can make a loop that calls the print function repeatedly or you can put that code inside the print function.TEST CASES: April 30, 2023 and May 12, 2023. In this example you need to carefully consider what data types to use. For example, the credit…arrow_forwardA vector in Matlab has magnitude and direction is an array with only one column or one row is a table of numbers contains at most three numbers, one for each dimension. When adding two arrays in Matlab the arrays only need to have the same number of elements the arrays must have the exact same size and shape you need to put a period in front of the plus sign both b and c are true When combining a scalar c to an array A with a command like c + A Matlab adds the c to every element in A an error is displayed because the dimensions are different the result will be different than the command A + carrow_forward
- Using the data file below design a hierarchical struct to organize the data. Then declare an array of structs for the reservations. The data file contains ten reservations. There are 8 columns of data: party name, size, date and time for the reservation, phone number, email address, credit card number and expiration date for the credit card. The data can be read from the file below so you will not need to type it in repeatedly. Once you have populated the array with data perform the following tasks: Write a function that will print out to the screen the information for one reservation.In the main program write code that prompts the user to enter a date in the form MM DD YYYYCall the function to print out all reservations on that date. You can make a loop that calls the print function repeatedly or you can put that code inside the print function.TEST CASES: April 30, 2023 and May 12, 2023. In this example you need to carefully consider what data types to use. For example, the credit…arrow_forwardCreate a visitors application that prompts the user for the number of visitors each day for the past 5 days and then displays the average number of visitors per day. (use & to accept new value) Use PL/SQL Array (NUMBER type basic composite array type ) and array has to have 5 members only. The application output should look like same as following: Test: If you receive below numbers from user then your average should be 234. Display avarage on screen. 1: 150 2: 220 3: 180 4: 300 5: 320 The average number of visitors is: 234 Hint : Once you create Array DECLARE TYPE my_array_type IS TABLE OF number INDEX BY PLS_INTEGER; v_n_array my_array_type; Then in the BEGIN and END block accept new value for each array members. DO NOT Use LOOP to accept new & as it is not design to get new value via loop.. Instead use separate 5 different &substitution value to get each values from user input BEGIN…arrow_forwardYou can use any C# compiler or the method you already know. The following table contains quarterly sales figures for five (5) departments: Quarter 1 Quarter 2 Quarter 3 Quarter 4 Total Department 1 750 660 910 800 Department 2 800 700 950 900 Department 3 700 600 750 600 Department 4 850 800 1000 950 Department 5 900 800 960 980 Total Design and write a Windows program/module named SalesAnalysis that will: Declare a two-dimensional integer array named sales – (Note: you have 6 rows and 5 columns) - that will hold the 4 quarterly sales for 5 departments Populate the first four columns for the 5 departments using the data in the preceding table. Contain a loop to compute and populate the total column. Store each department’s total in the array as it is being computed. Contain a loop to compute and populate the total row. Store each quarter’s total in the array as it is being computed.…arrow_forward
- The running time of locating the ith item in an array is ____. Question 9 options: O(1) O(n) O(log n) O(n2)arrow_forwardWhat values will be written to the array when the following code executes? data array DWORD 4 DUP(0) code main PROC mov eax, 5 mov esi, 0 call proc_1 add esi,4 add eax 3 k mov array[esi] eax INVOKE ExitProcess 0 main ENDF proc 1 PROC call proc_2 add esi, 4 add eax, 3 mov array[esi], eax ret proc 1 ENDP proc 2 PROC call proc_3 add esi.4 add eax 3 mov array[esi] eax ret Proc RENDE proc_3 PROC mov array[esi] eax ProcA ENDP Answer: arrayarrow_forwardIf an array variable is declared as score[7] then the valid range of array indexes for score is 0...7 Select one: True Falsearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education