Question: Last Real World problem (in module 04 - 05), you added functionality to allow the user to enter multiple patients until the user indicated done.

Last Real World problem (in module 04 - 05), you added functionality to allow the user to enter multiple patients until the user indicated done. You are to enhance this functionality. Add the following functionality to your report app:

Read the attached text fileLast Real World problem (in module 04 - 05), you added functionality via your report app. Your app should read this file. If Ithe data within the file (using the exact same format) is changed, the report should read the new data and format the report correctly. As long as the file is in the same format as outlined here:

Each field in this file is delimited by a carat (^)

The fields included in this file are ID^Last Name^First Name^Address Line 1^Address Line 2(optional)^City^State^Zip^ZipPlus4(Optional)^Payment Date^Payment Amount^Amount Owed

The fields marked as optional may not contain data. For example, the format might appear like this:

ID^Last Name^First Name^Address Line 1^^City^State^Zip^^Payment Date^Payment Amount^Amount Owed

When producing the report

Skip those fields that are not part of the report format

Rearrange those fields that are in a different order so they correspond to the report format

Add a prompt to the user "Do you want to output the report to the screen ('S'), to a file ('F') or both ('B')".

If the user enters 'S' your code should display the report to the screen as it currently does.

Whether the user enters an uppercase or lowercase letter should not matter. For example 'S' or 's' should not matter. In both cases, the user should display the data as described above.

If the user enters "F" (or "f"), then the app should

Prompt the user for the desired file name (including the file path)

Output the report to a file using the file name / path the user entered. This output should be in the exact same format as the report is-if sent to the screen except that it outputs the report to a file.

If the user enters "B" (or "b"), then the app should output the report to both the screen and output it to a file.

Contents of text file mentioned above

12345^Jones^John^1234 Test Drive^PO box 123^Test

City^IN^11234^1234^12/05/2015^250.00^25000.00

12346^Jones^Sara^1234 Test Drive^PO box 123^Test

City^IN^11234^1234^12/20/2017^50.00^50000.00

12347^Doe^John^1235 XYZ Drive^^Test

City^IN^11234^^01/05/2016^350.00^56799.00

12348^Doe^Sara^1235 XYZ Drive^^Test

City^IN^11234^^11/09/2017^100.00^5020.52

12349^Lawson^Lonnie^12 South Drive^^Test

City^IN^11236^^03/15/2013^253.51^25065.52

12349^Anderson^Sara^156 North Avenue^^Test

City^IN^11246^^05/05/2013^21.33^251.56

12350^Smith^Andy^2455 East Street^^Test

City^IN^11246^^12/05/2017^365.21^2543.33

Language is Java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!