Homework #10

Due on 4/21 at 11:59pm.

Code can be up to 2 days late with a 10% point deduction taken each late day.


Introduction

We can do a lot of really neat things with data files that we find on the Internet. I found a real, interesting data file about the registered dogs in New York City (NYC)!

To get started you should download the following file by right-clicking on it and clicking "save as" or "save link as":

This file is fairly large but it contains some a list of data for dogs registered in New York City. (It may take awhile for your computer to load it in a text editor because it is so large!) Notice that the file has data seperated by tabs (not commas or spaces). This is new to us, but many data files are stored this way. Note that when you use the .split() method later in your code, you will want to split on tabs like this:

lineList = line.split("\t")

 


Specifics

In this assignment you will make several functions. You can make more functions than the ones listed below to "help" in your implementation, but keep in mind that the program submission system is expecting to see and call the 3 functions below.

In a file called: PA10.py

1) Create a funciton called: topTenNames()

2) Create a function called: topTenNamesGender()

3) Create a function called: spayedDogs()

This function should:

Note: This turns out to be a great wrap up of lists, dictionaries, and functions. It uses a nice mixture of all of the topics we have studied in the class. When you are done you will likely be surprised at how small the code is. But it is very likely that this will take you longer than you would like. To save yourself some time we strongly suggest you sit down and work through the code on paper/pencil first. Think about all of the information that needs to be gathered, how it is gathered, how it is stored, and how it is processed.


Final Submission

Please upload your program to the program submission system. The program is worth 25 points. The program submission system will be running your three functions individually.