SlideShare a Scribd company logo
1 of 4
Introduction
This assignment will give you practise w/user and program
interfaces, and choosing/building useful data structures.
You will maintain a flat-file database, allowing users to query,
delete a entry, create an entry.
You'll also, for some practise, submit a make file.
The Assignment
Write a command-line utility called
cddb
to maintain a flat-file database of album information. You will
allow the user to view album info, add a new entry, or delete an
entry, where each entry is an album w/all of the track
information, as follows:
Options, and Descriptions
-l
— List album
Display an enumerated, alphabetical list of artists†
You will allow the user to choose an artist by entering the
number, or to quit by entering a
q
You will then list all albums, by release date, enumerated
Allow the user to choose an album, by #, or return to the menu
above (artists) by entering
a
If an album is entered, list all songs in that album, by track
order. Prompt for input to return to the previous (i.e., the
album) menu
-d
— Delete album. Similar to above, display menus allowing a
user to choose an album to delete
-a
— Add album. You'll prompt for artist, album name, release
date, and finally the track list. You may assume that they are
entered in track order.
You'll want to check that the album doesn't already exist before
adding it
-h
— Show usage msg and quit
†You may assume that all names are entered exactly. That is, do
not worry about inconsistencies in spelling or capitalisation.
E.g.,
Led Zeppelin
,
LedZeppelin
, and
led zeppelin
are 3 different groups for this assignment.
If no argument is supplied, a bad argument is supplied, or
multiple arguments, print a usage message and exit.
File Format
Album information will be stored in a flat file w/the format
shown in
sample.db
:
To simplify things, the filename (location of the DB) will be
stored in an exported environment variable,
$CDDB
.
Target Language
You will do this in Python3.
Hints (maybe)
I'd create some data structure to represent an album
Store albums in a dictonary, keyed by artist
When updating the DB (writing the new file out), write to a
temporary file. If this is successful, rename it appropriately.
This is generally an atomic operation. So, if something bad
happens w/your program, or the power grid, etc., you don't blow
your DB up
Submission
Submit the following files:
cddb
— Your top-level Python script
Makefile
— your makefile, with the folowing targets:
clean — cleans up all intermediate and resulting files and
directories (if any)
view — display any source code that you wrote, in a pager
Any other needed (Python) files
README
optional
— anything you want to say to me before I grade.

More Related Content

More from mariuse18nolet

IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docxIoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docxmariuse18nolet
 
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docx
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docxIP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docx
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docxmariuse18nolet
 
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docx
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docxIranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docx
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docxmariuse18nolet
 
ipopulation monitoring in radiation emergencies a gui.docx
ipopulation monitoring in radiation emergencies a gui.docxipopulation monitoring in radiation emergencies a gui.docx
ipopulation monitoring in radiation emergencies a gui.docxmariuse18nolet
 
In Innovation as Usual How to Help Your People Bring Great Ideas .docx
In Innovation as Usual How to Help Your People Bring Great Ideas .docxIn Innovation as Usual How to Help Your People Bring Great Ideas .docx
In Innovation as Usual How to Help Your People Bring Great Ideas .docxmariuse18nolet
 
Investor’s Business Daily – Investors.comBloomberg Business – Blo.docx
Investor’s Business Daily –  Investors.comBloomberg Business – Blo.docxInvestor’s Business Daily –  Investors.comBloomberg Business – Blo.docx
Investor’s Business Daily – Investors.comBloomberg Business – Blo.docxmariuse18nolet
 
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docx
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docxInvitation to Public Speaking, Fifth EditionChapter 8 Introdu.docx
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docxmariuse18nolet
 
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docx
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docxInvitation to the Life SpanRead chapters 13 and 14.Objectives.docx
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docxmariuse18nolet
 
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docx
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docxIOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docx
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docxmariuse18nolet
 
INVITATION TO Computer Science 1 1 Chapter 17 Making .docx
INVITATION TO  Computer Science 1 1 Chapter 17 Making .docxINVITATION TO  Computer Science 1 1 Chapter 17 Making .docx
INVITATION TO Computer Science 1 1 Chapter 17 Making .docxmariuse18nolet
 
Investment Analysis & Portfolio Management AD 717 OLHomework E.docx
Investment Analysis & Portfolio Management AD 717 OLHomework E.docxInvestment Analysis & Portfolio Management AD 717 OLHomework E.docx
Investment Analysis & Portfolio Management AD 717 OLHomework E.docxmariuse18nolet
 
Investment BAFI 1042 Kevin Dorr 3195598 GOODMAN .docx
Investment BAFI 1042  Kevin Dorr 3195598  GOODMAN .docxInvestment BAFI 1042  Kevin Dorr 3195598  GOODMAN .docx
Investment BAFI 1042 Kevin Dorr 3195598 GOODMAN .docxmariuse18nolet
 
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docx
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docxINVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docx
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docxmariuse18nolet
 
Investigation 6Fraud Investigation Paper.docx
Investigation     6Fraud Investigation Paper.docxInvestigation     6Fraud Investigation Paper.docx
Investigation 6Fraud Investigation Paper.docxmariuse18nolet
 
Investment BankingTwo basic methods exist for transferring funds.docx
Investment BankingTwo basic methods exist for transferring funds.docxInvestment BankingTwo basic methods exist for transferring funds.docx
Investment BankingTwo basic methods exist for transferring funds.docxmariuse18nolet
 
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docx
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docxInvited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docx
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docxmariuse18nolet
 
Investigating Our Cultural Norms 1Investiga.docx
Investigating Our Cultural Norms                1Investiga.docxInvestigating Our Cultural Norms                1Investiga.docx
Investigating Our Cultural Norms 1Investiga.docxmariuse18nolet
 
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docx
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docxInvestigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docx
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docxmariuse18nolet
 
IPO PresentationYou work for a medium sized privately held elec.docx
IPO PresentationYou work for a medium sized privately held elec.docxIPO PresentationYou work for a medium sized privately held elec.docx
IPO PresentationYou work for a medium sized privately held elec.docxmariuse18nolet
 

More from mariuse18nolet (20)

IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docxIoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
IoT Referenceshttpswww.techrepublic.comarticlehow-to-secur.docx
 
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docx
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docxIP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docx
IP Subnet Design Project- ONLY QUALITY ASSIGNMENTS AND 0 PLAG.docx
 
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docx
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docxIranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docx
IranAyatollahTheocracyTwelver ShiismVilayat-e Faghih (jur.docx
 
ipopulation monitoring in radiation emergencies a gui.docx
ipopulation monitoring in radiation emergencies a gui.docxipopulation monitoring in radiation emergencies a gui.docx
ipopulation monitoring in radiation emergencies a gui.docx
 
In Innovation as Usual How to Help Your People Bring Great Ideas .docx
In Innovation as Usual How to Help Your People Bring Great Ideas .docxIn Innovation as Usual How to Help Your People Bring Great Ideas .docx
In Innovation as Usual How to Help Your People Bring Great Ideas .docx
 
Investor’s Business Daily – Investors.comBloomberg Business – Blo.docx
Investor’s Business Daily –  Investors.comBloomberg Business – Blo.docxInvestor’s Business Daily –  Investors.comBloomberg Business – Blo.docx
Investor’s Business Daily – Investors.comBloomberg Business – Blo.docx
 
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docx
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docxInvitation to Public Speaking, Fifth EditionChapter 8 Introdu.docx
Invitation to Public Speaking, Fifth EditionChapter 8 Introdu.docx
 
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docx
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docxInvitation to the Life SpanRead chapters 13 and 14.Objectives.docx
Invitation to the Life SpanRead chapters 13 and 14.Objectives.docx
 
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docx
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docxIOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docx
IOBOARD Week 2 Lab BPage 2 of 4Name _________________ Gr.docx
 
INVITATION TO Computer Science 1 1 Chapter 17 Making .docx
INVITATION TO  Computer Science 1 1 Chapter 17 Making .docxINVITATION TO  Computer Science 1 1 Chapter 17 Making .docx
INVITATION TO Computer Science 1 1 Chapter 17 Making .docx
 
Investment Analysis & Portfolio Management AD 717 OLHomework E.docx
Investment Analysis & Portfolio Management AD 717 OLHomework E.docxInvestment Analysis & Portfolio Management AD 717 OLHomework E.docx
Investment Analysis & Portfolio Management AD 717 OLHomework E.docx
 
Investment BAFI 1042 Kevin Dorr 3195598 GOODMAN .docx
Investment BAFI 1042  Kevin Dorr 3195598  GOODMAN .docxInvestment BAFI 1042  Kevin Dorr 3195598  GOODMAN .docx
Investment BAFI 1042 Kevin Dorr 3195598 GOODMAN .docx
 
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docx
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docxINVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docx
INVESTING IN STOCKS AND BONDSWhy Consider BondsBond.docx
 
Investigation 6Fraud Investigation Paper.docx
Investigation     6Fraud Investigation Paper.docxInvestigation     6Fraud Investigation Paper.docx
Investigation 6Fraud Investigation Paper.docx
 
Investment BankingTwo basic methods exist for transferring funds.docx
Investment BankingTwo basic methods exist for transferring funds.docxInvestment BankingTwo basic methods exist for transferring funds.docx
Investment BankingTwo basic methods exist for transferring funds.docx
 
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docx
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docxInvited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docx
Invited Paper – EDSIGCON 2017 Keynote Reflections on the Cur.docx
 
Investigating Our Cultural Norms 1Investiga.docx
Investigating Our Cultural Norms                1Investiga.docxInvestigating Our Cultural Norms                1Investiga.docx
Investigating Our Cultural Norms 1Investiga.docx
 
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docx
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docxInvestigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docx
Investigation of Terrorism - CRJ 460 2Module 4 - Homework Assign.docx
 
iProfile 3.0 .docx
iProfile 3.0                                                  .docxiProfile 3.0                                                  .docx
iProfile 3.0 .docx
 
IPO PresentationYou work for a medium sized privately held elec.docx
IPO PresentationYou work for a medium sized privately held elec.docxIPO PresentationYou work for a medium sized privately held elec.docx
IPO PresentationYou work for a medium sized privately held elec.docx
 

IntroductionThis assignment will give you practise wuser and pr

  • 1. Introduction This assignment will give you practise w/user and program interfaces, and choosing/building useful data structures. You will maintain a flat-file database, allowing users to query, delete a entry, create an entry. You'll also, for some practise, submit a make file. The Assignment Write a command-line utility called cddb to maintain a flat-file database of album information. You will allow the user to view album info, add a new entry, or delete an entry, where each entry is an album w/all of the track information, as follows: Options, and Descriptions -l — List album Display an enumerated, alphabetical list of artists† You will allow the user to choose an artist by entering the number, or to quit by entering a q You will then list all albums, by release date, enumerated Allow the user to choose an album, by #, or return to the menu
  • 2. above (artists) by entering a If an album is entered, list all songs in that album, by track order. Prompt for input to return to the previous (i.e., the album) menu -d — Delete album. Similar to above, display menus allowing a user to choose an album to delete -a — Add album. You'll prompt for artist, album name, release date, and finally the track list. You may assume that they are entered in track order. You'll want to check that the album doesn't already exist before adding it -h — Show usage msg and quit †You may assume that all names are entered exactly. That is, do not worry about inconsistencies in spelling or capitalisation. E.g., Led Zeppelin , LedZeppelin , and led zeppelin are 3 different groups for this assignment. If no argument is supplied, a bad argument is supplied, or
  • 3. multiple arguments, print a usage message and exit. File Format Album information will be stored in a flat file w/the format shown in sample.db : To simplify things, the filename (location of the DB) will be stored in an exported environment variable, $CDDB . Target Language You will do this in Python3. Hints (maybe) I'd create some data structure to represent an album Store albums in a dictonary, keyed by artist When updating the DB (writing the new file out), write to a temporary file. If this is successful, rename it appropriately. This is generally an atomic operation. So, if something bad happens w/your program, or the power grid, etc., you don't blow your DB up Submission Submit the following files:
  • 4. cddb — Your top-level Python script Makefile — your makefile, with the folowing targets: clean — cleans up all intermediate and resulting files and directories (if any) view — display any source code that you wrote, in a pager Any other needed (Python) files README optional — anything you want to say to me before I grade.