Problem

The text files boynames.txt and girlnames.txt, which are included in the source code on th...

The text files boynames.txt and girlnames.txt, which are included in the source code on this book’s website, contain a list of the 1,000 most popular boy and girl names in the United States for the year 2003 as compiled by the Social Security Administration.

These are blank-delimited files where the most popular name is listed first, the second most popular name is listed second, and so on to the 1,000th most popular name, which is listed last. Each line consists of the first name, followed by a blank space, followed by the number of registered births in the year using that name. For example, the girlnames.txt file begins with

Emily 25494

Emma 22532

Madison 19986

This indicates that Emily is the most popular name with 25,494 registered namings, Emma is the second most popular with 22,532, and Madison is the third most popular with 19,986.

Write a program that reads both the girls’ and boys’ files into memory using arrays. Then, allow the user to input a name. The program should search through both arrays and, when there is a match, output the popularity and number of namings. The program should also indicate if there is no match.

For example, if the user enters the name “Justice,” the program should output

If the user enters the name “Walter,” the program should output

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12