15 Jun CD Database – Python3 profile
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.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.