Question: Python Programing Assignment: Baby Names [40 points] Every 10 years, the Social Security Administration gives data about the 1000 most popular boy and girl names
Python Programing Assignment:
Baby Names [40 points] Every 10 years, the Social Security Administration gives data about the 1000 most popular boy and girl names for children born in the US. This data is provided on the web at http://www.ssa.gov/OACT/babynames/. Your task in this program is to prompt the user for a name, and then to display popularity statistics about that name for each decade since 1900. Your program is to give an introduction and then prompt the user for a name to display. Then it will read a data file searching for that name. If the name is found in the file, you should print the name and the statistics about that name's popularity in each decade. Your program will read its data from a file named names.txt. Each line of this file has a name, followed by the popularity rank of that name in 1900, 1910, 1920, and so on. The default input file has 11 numbers per line, meaning that the last number represents the ranking in the year 2000. A rank of 1 was the most popular name that year, while a rank of 999 was not very popular. A rank of 0 means the name did not appear in the top 1000 that year at all. Here is a sample of the data: Lionel 387 344 369 333 399 386 408 553 492 829 972 Lisa 0 0 0 0 464 38 1 6 31 113 298 Lise 0 0 0 0 0 997 0 0 0 0 0 Lisette 0 0 0 0 0 0 0 816 958 0 864 "Lionel" was #387 in 1900 and is slowly decreasing. "Lisa" made the list in 1940 and peaked in 1960 at #1. If the name is not found in the file, you should simply output that it was not found. Your program should work correctly regardless of the capitalization the user uses to type the name. For example, if the user asks you to search for "LISA" or "lisa", you should find it even though the input file has it as "Lisa". The name that is displayed on the console should have capitalization matching the way it appears in the file. For this program you should have three constants to represent the following values: the name of the input file (default of "names.txt") the starting year of the input data (default of 1900) the number of decades' worth of data in each line of the file (default of 11) It should be possible to change these values and have your output adapt appropriately. For example, if you change the constant to 1800, the program will now assume the file data comes from the years 1800, 1810, and so on. On the course website is a second input file named names2.txt that has 8 decades worth of data you can use to test your file name constant.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
