1. Homepage
  2. Programming
  3. CP1404 - Programming II - Assignment 1 - Album 1.0

CP1404 - Programming II - Assignment 1 - Album 1.0

Engage in a Conversation
James Cook UniversityJCU澳洲AustraliaCP1404Programming IIAlbumPython

Assignment 1 – Albums 1.0 CourseNana.COM

Task: CourseNana.COM

Write a Python (3) program, as described in the following information and sample output. This assignment will help you build skills using decisions, repetition, file input/output, exceptions, lists, functions and string formatting. Do not define any of your own classes or use constructs that have not been taught in this subject. Assignment 2 will build on this with more advanced constructs including dictionaries, classes and a Graphical User Interface (GUI). CourseNana.COM

Some requirements have in-text help references, like [0], that refer to the resources list near the bottom of this document. Please check these references to find help on that topic. Everything you need to complete this assignment can be found in the subject materials. CourseNana.COM

Use and modify the starter files provided. Do not add any other files, and do not rename anything - just use this as your assignment directory. CourseNana.COM

Problem Description: CourseNana.COM

This program allows a user to track music albums they want to listen to (required) and albums they have already listened to (completed). The program reads and writes a list of albums in a text file. Each album has: CourseNana.COM

title, artist, year released, whether it is required (r) or completed (c) CourseNana.COM

Users can choose to display the list of albums , which will be sorted by artist, then by title. [1] CourseNana.COM

Did you see that reference? Look below for [1] and you’ll find out where we have taught you how to sort lists by multiple keys.
Users can add new albums and mark albums as completed.
They cannot change albums from completed to required.
CourseNana.COM

As demonstrated in the sample output below, your program should: CourseNana.COM

  • display a welcome message with your name
  • display a menu for the user to choose from [2, 3]
  • error-check user inputs (see sample output for example checks and outputs) [4]
  • load a CSV (Comma Separated Values) file of albums (just once at the very start); a sample CSV file is provided for you and you must use this format [5] (note: you're not expected to use the csv module, but you're welcome to)
  • when the user chooses list: display a neatly formatted (lined up) list of all the albums with their details and the number of albums you need to listen to [4]. Required albums have a * next to them. Note that the lining up is based on the longest title and artist [6]
  • when the user chooses add: prompt for the album’s title, artist and year, error-checking each of these [3], then add the album to the list in memory (not to the file); new albums are always required
  • when the user chooses mark completed: display the list of all albums (same as for the list option), then allow the user to choose one album (error-checked), then change that album to completed

o if there are no required albums, then "No required albums" should be displayed CourseNana.COM

  • when the user chooses quit: save the albums to the CSV file (note that this should be the only time that the file is saved)

Sample output from the program is provided below. Ensure that your program matches this, including spaces, spelling, and the formatting of the album lists. Think of this as helpful guidance as well as training you to pay attention to detail. The sample output is intended to show a large (but maybe not exhaustive) range of situations including user input error handling. CourseNana.COM

Coding Requirements and Expectations: CourseNana.COM

  1. Makeuseofnamedconstantsasappropriate(e.g.,forthecharactersthatrepresent the album's required/completed status).
  2. Usefunctionsappropriatelyforeachsignificantpartoftheprogram.Followprinciples you've learned about functions, including the single responsibility principle (SRP).
  3. Onlyload(read)thealbumsfileonce, whentheprogramstarts.
  4. Onlysave(write)thealbumsfileonce, whentheprogramends.
  5. Storethealbumdatainalistoflistsandpassthattoanyfunctionsthatneedaccess to it. Note: this variable should not be global. The only global variables you may have are CONSTANTS. (Did you understand this? If you use global variables, your functions will be poorly designed. Do not use any global variables.)
  6. Donotstoreanalbum'sindex/number–thisisjustbasedonitspositioninthelist.
  7. Themenuchoiceshouldhandleuppercaseandlowercaseletters.
  8. Useexceptionhandlingwhereappropriatetodealwithinputerrors(includingentering numbers and selecting albums). You should be able to use generic, customisable functions to perform input with error checking (e.g., getting the album title and artist can reuse the same function).
  9. Theoutputshowsthatthesolutiondoesnotrequirecorrectplurals(e.g.,"1albums"). You are welcome to leave yours this way. You may add logic to print these statements correctly, but it is not expected or assessed.

We strongly suggest you work incrementally on this task: focus on completing small parts rather than trying to get everything working at once. This is called "iterative development" and is a common way of working, even for professionals.
Check the rubric below carefully to understand how you will be assessed. There should be no surprises here – this is about following the best practices we have taught in class.
CourseNana.COM

Submission: CourseNana.COM

Zip up your project directory as it is, then submit this zip file. Ensure that you do NOT include a venv (virtual environment). Name the file like: FirstnameLastnameA1.zip. Upload your single zip file to the assignment submission on your subject website. CourseNana.COM

Due: CourseNana.COM

Submit your assignment by the date and time specified. Submissions received after this date will incur late penalties. CourseNana.COM

Sample Output: CourseNana.COM

The following sample run was made using a CSV file that contained: CourseNana.COM

The Dark Side of the Moon,Pink Floyd,1973,r Common Jasmin Orange,Jay Chou,2004,r
After the Music Stops,Lecrae,2006,c Honey,Lay,2019,c
CourseNana.COM

You should be able to figure out what parts of the sample output below are user input. CourseNana.COM

Albums 1.0 - by Lindsay Ward 4 albums loaded
Menu:
L - List all albums
CourseNana.COM

A - Add new album
M - Mark an album as completed Q - Quit
>>> user input here
Invalid menu choice
Menu:
L - List all albums
A - Add new album
M - Mark an album
Q - Quit
>>> l
*1. Common Jasmin
CourseNana.COM

2. Honey CourseNana.COM

3. After the Music Stops
*4. The Dark Side of the Moon You need to listen to 2 albums. Menu:
L - List all albums
A - Add new album
M - Mark an album
Q - Quit
>>> m
*1. Common Jasmin
CourseNana.COM

2. Honey CourseNana.COM

2. Honey CourseNana.COM

by Jay Chou by Lay
by Lecrae
by Pink Floyd
CourseNana.COM

3. After the Music Stops
*4. The Dark Side of the Moon You need to listen to 2 albums. Menu:
L - List all albums
A - Add new album
M - Mark an album
Q - Quit
>>> m
*1. Common Jasmin
CourseNana.COM

2. Honey CourseNana.COM

You need to listen to 1 albums. Menu:
L - List all albums
A - Add new album
CourseNana.COM

M - Mark an album as completed Q - Quit

CourseNana.COM

3. After the Music Stops
*4. The Dark Side of the Moon
You need to listen to 2 albums.
Enter the number of an album to mark as completed >>> incorrect
Invalid input; enter a valid number
>>> -2
Number must be > 0
>>> 0.2
Invalid input; enter a valid number
>>> 0
Number must be > 0
>>> 3
You have already listened to After the Music Stops Menu:
L - List all albums
A - Add new album
M - Mark an album
Q - Quit
>>> L
*1. Common Jasmin
CourseNana.COM

References – Resources from Subject Materials: CourseNana.COM

Selected subject materials are referenced here to help you find guidance for specific parts of the assignment (e.g., sorting a list by multiple values is covered in [1] and you will find a template for writing menus for console programs in [2]).
General references are not listed specifically but should be obvious (e.g., file input/output is covered in the lecture and practical on files).
CourseNana.COM

You should find the programming patterns "cheat sheet" helpful for several things. This is provided on GitHub or as a PDF in your subject website: https://github.com/CP1404/Starter/wiki/Programming-Patterns CourseNana.COM

  1. itemgetter from Chapter 7 - Lists and Tuples.
  2. Practical 01 - PyCharm, Control.

https://github.com/CP1404/Practicals/tree/master/prac_01 CourseNana.COM

  1. Programming Patterns. https://github.com/CP1404/Starter/wiki/Programming-Patterns
  2. Practical 02 - Strings, Files, Exceptions.

https://github.com/CP1404/Practicals/tree/master/prac_02 CourseNana.COM

  1. Chapter 5 - Files and Exceptions 1.
  2. Practical 05 - Dictionaries, Code Reviews with PRs.

https://github.com/CP1404/Practicals/tree/master/prac_05 CourseNana.COM

  1. Negotiating the Maze of Academic Integrity in Computing Education.

https://dl.acm.org/citation.cfm?doid=3024906.3024910 CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
James Cook University代写,JCU代写,澳洲代写,Australia代写,CP1404代写,Programming II代写,Album代写,Python代写,James Cook University代编,JCU代编,澳洲代编,Australia代编,CP1404代编,Programming II代编,Album代编,Python代编,James Cook University代考,JCU代考,澳洲代考,Australia代考,CP1404代考,Programming II代考,Album代考,Python代考,James Cook Universityhelp,JCUhelp,澳洲help,Australiahelp,CP1404help,Programming IIhelp,Albumhelp,Pythonhelp,James Cook University作业代写,JCU作业代写,澳洲作业代写,Australia作业代写,CP1404作业代写,Programming II作业代写,Album作业代写,Python作业代写,James Cook University编程代写,JCU编程代写,澳洲编程代写,Australia编程代写,CP1404编程代写,Programming II编程代写,Album编程代写,Python编程代写,James Cook Universityprogramming help,JCUprogramming help,澳洲programming help,Australiaprogramming help,CP1404programming help,Programming IIprogramming help,Albumprogramming help,Pythonprogramming help,James Cook Universityassignment help,JCUassignment help,澳洲assignment help,Australiaassignment help,CP1404assignment help,Programming IIassignment help,Albumassignment help,Pythonassignment help,James Cook Universitysolution,JCUsolution,澳洲solution,Australiasolution,CP1404solution,Programming IIsolution,Albumsolution,Pythonsolution,