Question: Write a program that reads source file ( babynames . txt ) and produces two files boynames.txt and girlnames.txt; also produce another file that has

Write a program that reads source file (babynames.txt) and produces two files boynames.txt and girlnames.txt; also produce another file that has a list of names that are both boy and girl names (such Morgan or Alexis).
Source File: babynames.txtDownload babynames.txt
Note: In the source file, each row has two names: 1st name is the boy name and the 2nd name is the girl name.
Hint: Read each line from babynames.text, parse it and write the 1st name in the boynames.txt and the 2nd name in the girlnames.txt; for names that are common, read boy and girl names in two array list, for each name in the boy arraylist, see if there is corresponding entry in the girl arraylist - if yes, than the name is common.
Make sure you implement File Not Found Exception.

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!