This is just get you started on some things you will need to do for lab 11. You do not need to submit anything for this part. However, we strongly suggest that you do this part prior to starting the regular lab 11 assignment that will be assigned early next week.
Run update21 to create the cs21/labs/11 directory. Then cd into your cs21/labs/11 directory and create the python programs for lab 11 in this directory. After running update21, you will have a file named cd.db that contains an example database of CD information.
For lab 11 you will write a program that reads in information from a CD data base into a list and then enters a loop with the following menu options for performing different operations on the list:
James Brown,Get on the Good Foot,1972 Sleater-Kinney,Dig Me Out,1997
Once you have this class written, add a main function, and test the class by creating some CDInfo objects and calling their method functions.
Next, implement some functions that you will use as starting points for your lab 11 assignment:
Once this is working, apply some top-down-design to add other functions
to your program. Add them just as function shells for now, but think
about what values they need to be passed and what they return, and you
could try adding calls to the function shells from main. We do not
recommend that you implement full functionality for these because
you are not going to be using a list of CDInfo objects for lab 11,
but a linked-list of CDInfoNode objects instead.
$ python cdinfo.py ############## CD DB Menu ######################## 1. Print all CDs by a given artist and the total number 2. Print all CDs with a given title and the total number 3. Print all CDs released on a give year and the total number 4. Print all CDs in the DB and the total number 5. Add a new CD to the DB 6. Quit ###################################################### Enter a value between 1 and 6 : hello Hey, hello isn't a number...try again Enter a value between 1 and 6 : 12 Hey, 12 isn't between 1 and 6 ...try again Enter a value between 1 and 6 : 1 Option 1 not yet supported ############## CD DB Menu ######################## 1. Print all CDs by a given artist and the total number 2. Print all CDs with a given title and the total number 3. Print all CDs released on a give year and the total number 4. Print all CDs in the DB and the total number 5. Add a new CD to the DB 6. Quit ###################################################### Enter a value between 1 and 6 : 4 The CD DB: --------- Public Enemy, It Takes a Nation of Millions to Hold Us Back, 1988 James Brown, Get on the Good Foot, 1972 Sly & the Family Stone, Fresh, 1973 Bob Marley, Survival, 1979 De La Soul, 3 Feet High and Rising, 1989 Patti Smith, Horses, 1975 Sleater-Kinney, Dig Me Out, 1997 X, Under the Big Black Sun, 1982 Charles Mingus, Mingus Ah Um, 1959 X, More Fun in the New World, 1983 Sleater-Kinney, One Beat, 2002 Killdozer, For Ladies Only, 1989 MC5, Kick Out the Jams, 1969 Spot 1019, Spot 1019, 1986 De La Soul, De La Soul Is Dead, 1991 X, Los Angeles, 1980 The Fall, The Infotainment Scan, 1993 Al Green, Greatest Hits, 2005 Ramones, Greatest Hits, 1990 Sly & the Family Stone, Greatest Hits, 1970 Sly & the Family Stone, There's a Riot Goin' On, 1971 There are a total of 21 CDs in the library ############## CD DB Menu ######################## 1. Print all CDs by a given artist and the total number 2. Print all CDs with a given title and the total number 3. Print all CDs released on a give year and the total number 4. Print all CDs in the DB and the total number 5. Add a new CD to the DB 6. Quit ###################################################### Enter a value between 1 and 6 : 6 bye bye