Question: Programming Language: Java 8 applicationusing lambda and streams. NO expressions such as while or for loops Objective: Reads two input files: One file which stores
Programming Language: Java 8 applicationusing lambda and streams. NO expressions such as while or for loops
Objective: Reads two input files: One file which stores information about the counties, states, zip code. And the other file stores information about people's firstName, lastName, income, zipcode. Narrow the information down to Virginia (VA), calculate the average income in each county, and then print all people along with their income relative to their county average.
Note: The input will consist of two text files. The paths to these files (first: counties, second: people) should be passed to the java application using command-line arguments,
e.g. java javaFileName counties.txt people.txt
Files Example:
Counties file: Each line consists of three pieces of information describing a zip-code area, separated by commas: COUNTY,STATE_ABBREV,ZIPCODE For example (counties.txt):
Henrico,VA,23229
Henrico,VA,23228
Richmond,VA,23284
Greensboro,NC,27214
.
.
People file: Each line consists of four pieces of information describing a person, separated be commas: FIRST_NAME,LAST_NAME,INCOME,ZIPCODE
For example (peoples.txt):
John,Doe,10000,23228
Jane,Doe,20000,23228
John,Smith,30000,23229
Mike,Morris,40000,23284
Nancy,Nansemond,50000,23284
Rick,Radon,60004,23229
Ben,Brown,60000,27214
Note: Income will be a positive integer. The combination (First Name, Family Name, ZIP code) will uniquely describe each line, i.e., there will be no two lines that have the same all three of the above. However, there may be e.g. two people with the same first and last names in two different ZIP code in the same county.
Output



For each person that lives in Virginia one line should be produced on the output (System out. It should contain four pieces of information FIRST NAME LAST NAME RELATIVE INCOME COUNTY, in that order, separated by a single space. Relative income should be rounded to the nearest integer before printing. The order of people should be: decreasing order of relative income if tie, alphabetical order by family name if still tie, alphabetical order by first name if still tie, alphabetical order by county
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
