Please refer to this site for the txt files that the question
refers to.
www.ssa.gov/oact/babynames/
Question 3 (10 marks): The baby names from years 2001 to 2010 are downloaded from Blackboard and stored in files named babynameranking2001.txt, babynameranking2002.txt,... babynameranking2010.txt. Each file contains one thousand lines. Each line contains a ranking, a boy's name, number for the boy's name, a girl's name, and number for the girl's name. For example, the first two lines in the file babynameranking2010.txt are as follows: 1 Jacob 21,875 Isabella 22,731 2 Ethan 17,866 Sophia 20,477 So, the boy's name Jacob and girl's name Isabella are ranked #1 and the boy's name Ethan and girl's name Sophia are ranked #2. 21,875 boys are named Jacob and 22,731 girls are named Isabella. (Sort names without duplicates). Write a program that reads the names from the all the ten files described above, sorts all names (boy and girl names together, duplicates removed), and stores the sorted names in one file ten per line. *Requirements: Use try-catch block and throw appropriate exception when the given information/data/filename is invalid.
Please refer to this site for the txt files that the question refers to. www.ssa.gov/oact/babynames/
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am