The web sites http://www.census.gov/genealogy/names/dist.male.first and http://www.census.gov/genealogy/names/dist.female.first contain baby names sorted by popularity. The format is very simple: name, frequency, cumulative frequency, and rank. Load these pages into your browser to see for yourself.
Your task is to write a program that connects to these sites and prints the top 50% of male and female names. Stop when the cumulative percentage has exceeded 50%.