Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prem is a loan officer, He scanned a pile of documents from his desk for different mortgage applications. Some of the loan applications are missing

Prem is a loan officer, He scanned a pile of documents from his desk for different mortgage applications. Some of the loan applications are missing required documents. Write a program to help him organize the documents, and determine which ones are missing.

Every document contains metadata, including:

- document name("fileName"),

- document owner("owner"),

- document type ("docType"),

- loan application ID ("applicationId"), and

- content length ("contentLength")

your task is to find all the document types that are missing for each loan application. Every loan application must include every document type. Since you are new to Prem's work, you don't know how many document types there are in total. You should figure that from the pile yourself.

Input (stdin):

Take input from a file("myFile.txt" download it from iLearn). A sample file input is given below as an example.

A comma delimited file with the first line as field names.

Input Sample file Example:

fileName,owner,docType,applicationId,contentLength

bank_statement_1,Sunny,bank_statement,1,1000

tax_document_1,Sunny,tax_return,1,16001

tax_document_2,Jay,tax_return,2,2000

document_123,Ram,tax_return,3,1500

medical_report,Ram,medical_history,3,15000

prescription,Jason,medical_history,4,200

property_assets,Jason,bank_statement,4,4000

OutPut (stdout):

- Print out two lines for each document type. The first line is document type. The second line are the application IDs that are missing for this type of document.

- Delimit the application IDs by one space

- Sort document types in alphabetical order. Sort application IDs in numerical order.

- Print only document types when they are missing for atleast one loan application.

Sample Output :

bank_statement

2 3

medical_history

1 2

tax_return

4

Explanation:

After scanning the given file we come to know that each application should contain bank_statement, medical_history and tax_return.

Jay and Ram are missing bank_statement in their application

Sunny and Jay are missing medical_history in their application

Jason is missing tax_return in his application

since Id of sunny is 1, Jay is 2, Ram is 3 and Jason is 4.

if we write all documents in alphabetical order and people who are missing them. Then the output would look like the sample output above.

Note: The content of "myFile.txt" will be changed while testing your program. So make sure your program works for more documents too.

Please turn in a working .cpp file that takes input from "myFile.txt" and displays output to the console in the format mentioned above.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

Attached herewith is a copy of our new contract for your records.

Answered: 1 week ago

Question

6. Conduct an implementation study of mini/focus lesson.

Answered: 1 week ago