Computer Science 111, Fall Semester, 2006
Homework #10

due: by midnight December 6, 2006

Your task in this week's project is expand your Hw7 to use objects instead of strings and to obtain data from amazon.com.

Preliminary Work

Do the following:

Interface to Amazon

  • Now insert the function definition for getCDsFromArtist from your lab10.py. Modify this function so it creates a list of instances of Site and returns this list, as below.
  • get a copy of the file cdsites.txt:
    getcopy cdsites.txt
    
  • Now in main
  • Read in the values from this file and make list of Site objects instead of a list of strings (the odl booklist). I call it siteList.
  • You will have to modify any of the functions that operated on booklist in homework7 so that they work with a list of Site objects. After the while loop, use your printSite() function to print out each Site object in siteList, then call selSort(), and then print each Site object in siteList again. as in hw7. However, you'll have to change selSort so it sorts the objects by ProductName Also, rewrite the sorted sites out to the file cdsitesSorted.txt. It should have exactly the same format as cdsites.txt. Make sure it doesn't have extra lines in it, and that there is only one value per line.

    What to submit. Your program should be in a file called hw10.py. Submit this homework by the due date with the command submit homework10 hw10.py