Question
The popularity ranking of baby names from years 2001 to 2010 has been downloaded from the Social Security Administrations website and stored in files named
The popularity ranking of baby names from years 2001 to 2010 has been downloaded from the Social Security Administrations website and stored in files named babynameranking2001.txt, babynameranking2002.txt, , babynameranking2010.txt. Each file contains one thousand lines. Each line contains a ranking, a boys name, number for the boys name, a girls name, and number for the girls name. These entries are separated by whitespace (tab or space). 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 boys name Jacob and girls name Isabella are ranked #1 and the boys name Ethan and girls name Sophia are ranked #2. 21,875 boys are named Jacob and 22,731 girls are named Isabella. Write a program that prompts the user to enter the year, gender, and followed by a name, and displays the ranking of the name for the year. Here are 2 sample runs:
Enter the year: 2010 Enter the gender: M Enter the name: Javier Javier is ranked #190 in year 2010 Enter the year: 2010 Enter the gender: F Enter the name ABC The name ABC is not ranked in year 2010
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started