You are writing a start-up-loan approval system for a bank.
The bank takes a maximum of 5000 loan applications and deny them only if the applicant doesn't qualify (he/she is not educated or experienced in the field). If the applicant qualifies, the loan will be eventually approved (although there is no guarantee if that happens in the lifetime of the applicant!).
The bankers may write commands like the following:
save_applicationsave_application "Golnar Sheikhshab" 10 3 150000 0 0 24000 40000 50000 24000 save_application "John Smith" 6 3 150000 0 0 25000 50000 50000 25000 save_application "Larry Page" 8 25 150000000 0 150000000 save_application "Some Guy" 4 13 120000 0 60000 90000 40000 save_application "Some Gal" 7 10 120000 0 60000 90000 40000 make_decisions "Oct 2nd, 2017" 300000 printIn the first application, the applicant_full_name is "Golnar Sheikhshab", the years_of_relevant_education and years_of_relevant_experience are 10 and 3 respecitvely, the loan_amount is 150000, and estimated_yearly_profits is {0, 0, 24000, 40000, 50000, 24000} making the priority = 0*1/1 + 0* 1/2 + 24000 * 1/3 + 40000* 1/4 + 50000 * 1/5 + 24000* 1/6 = 32000. Note that the number of years in estimated_yearly_profits differ from application to application.
To avoid bad input format, you can download this example of commands.txt from here.
Here is what happens when we run the program
./loan_approval.o commands.txt active_applications ("Larry Page",150000000) ("Golnar Sheikhshab",150000) approved_applications ("Some Guy",120000,"Oct 2nd, 2017") ("Some Gal",120000,"Oct 2nd, 2017") denied_applications ("John Smith",150000,"Oct 2nd, 2017")The program should be compiled as follows:
g++ -c loan_application.cpp g++ -o loan_approval.o loan_approval.cpp loan_application.o
Use the implementation of list that was provided for lab1. You may overload operator[] to access item i in the list if you need to. Do not change anything else as you will not be able to upload your version of ArrayList or SortedArrayList. We will test your program using the implementation provided for lab1, only we'll aso add the implementation of operator[].
./check_output.o expected.txt expected.txt ./check_output.o expected2.txt expected2.txt ./check_output.o expected3.txt expected3.txtand make sure all 3 score you get are 1.
By the way, you can use check_output.cpp as a sample for how to read from file, do tokenization, and use STL containers vector and set.