Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
CP1404/CP5632 Assignment 1 – Books to Read 1.0
Task:
You are to write a Python (3) program, as described in the following information and sample output. This assignment will help you build skills using selection, repetition, file input/output, exceptions, lists, functions and string formatting. Do not define any of your own classes or use constructs that haven't been taught in this subject. Assignment 2 will build on this with more advanced constructs including dictionaries, classes and a Graphical User Interface (GUI).
Everything you need to complete this assignment can be found in the subject materials. You should find the programming guides helpful, and you are expected to follow the style guide: https://github.com/CP1404/Starter/wiki
https://classroom.github.com/a/2GOH2f69
Do not use any other repo or a copy of this one... just use this repository!
This will give you a new repo containing starter files including a README for your project, all of which you must use. Do not add any other files in this project, and do not rename anything
Program Overview:
- title, author, number of pages, whether it is completed (c) or unread (u)
Program Functionality Details:
- Display a welcome message with your own name in it.
- Load a CSV text file of books (just once at the very start) into a list of lists - a sample
- Display a menu for the user to choose from until they choose to quit.
- Display: display a neatly lined up list of all the books with their details. Unread books have * next to them) and a count of these books. You need to determine the size of the title and author fields to get them to line up correctly.
- Add: prompt for the Book’s title, author and number of pages, error-checking each of these, then add the book to the book list in memory (not to the file); new books are always unread initially.
- Complete: prompt the user to choose one book by number, error-checking for a valid book number, then change that book's status to completed. If no books are unread, then display the message in the sample output below.
- When the user quits the menu, save the books to the CSV file, overwriting file contents.
Coding Requirements:
- Work incrementally on this task: complete small parts of it at a time rather than trying to get it all working at once.
- You are assessed on your use of version control including commits and commit messages, so please commit appropriately for each “small milestone” and use meaningful commit messages in the imperative voice, as taught in class. Your commits should show steady work completed over reasonable time, not all in a short period.
- Edit the module docstring at the very top of your code file to contain your own details.
- The menu should handle both uppercase and lowercase letters as valid choices.
- Make use of named constants as appropriate (e.g., for the characters that represent the completion status).
- Use functions appropriately for each significant part of the program: this is the divide and-conquer problem-solving approach. Follow the single responsibility principle.
- For efficiency, you should only load the books file once – when the program starts.
- Only save the books file once – when the user quits.
- Store the book data in a list of lists and pass this to any functions that need access to it. Do not store a book’s index – this is just its position in the list.
- Do not use any global variables. The only globals you may have are CONSTANTS. If you use global variables, your functions will be poorly designed.
- Use exception handling as appropriate to deal with input errors (including when entering numbers and selecting books). You should use generic, customisable functions to perform input with error checking (e.g., getting the title and author can reuse the same function).
Integrity:
The work you submit for this assignment must be your own. Submissions that are detected to be too similar to that of another student or other work (e.g., code found online or created with AI) will be dealt with according to the College procedures for handling plagiarism and may result in serious penalties.
The goals of this assignment include helping you gain understanding of fundamental programming concepts and skills, and future subjects will build on this learning. Therefore, it is important that you develop these skills to a high level by completing the work and gaining the understanding yourself. You may discuss the assignment with other students and get assistance from your peers, but you may not do any part of anyone else’s work for them and you may not get anyone else to do any part of your work. Note that this means you should never give a copy of your work to anyone or accept a copy of anyone else’s work, including looking at another student's work or having a classmate look at your work. If you require assistance with the assignment, please ask general questions on the
discussion forum, or get specific assistance with your own work by talking with your lecturer or tutor.
The subject materials (lectures, practicals, textbook and other guides provided in the subject) contain all the information you need for this assignment. Do not use online resources or GenAI (e.g., Stack Overflow, ChatGPT or other forums) to find resources or assistance as this would limit your learning and would mean that you would not achieve the goals of the assignment - mastering fundamental programming concepts and skills.
Submission:
Due:
Sample Output:
The following sample run was made using a CSV file that contained:
Starting Out with Python,Tony Gaddis,744,c
It should be clear what parts of the sample are user input for this sample run.
Marking Scheme:
- SLO1 - develop and utilise best-practice coding techniques to develop solutions
- SLO2 - select and apply appropriate and efficient data structures
- SLO3 - manage software projects using version control
Criteria |
Exemplary (9, 10) |
Good (7, 8) |
Satisfactory (5, 6) |
Limited (2, 3, 4) |
Very Limited (0, 1) |
Correctness
SLO1
20%
|
Program works correctly for all functionality required. |
Exhibits aspects of exemplary (left) and satisfactory (right) |
Program mostly works correctly for most functionality, but there is/are some required aspects missing or that have problems. |
Exhibits aspects of satisfactory (left) and very limited (right) |
Program works incorrectly for all functionality required. |
Error checking
SLO1
10%
|
Invalid inputs are handled well using exceptions and control logic as taught, for all user inputs. |
Invalid inputs are mostly handled correctly as taught, but there is/are some problem(s), e.g., exceptions not well used. |
Error checking is not done or is very poorly attempted. |
||
Similarity to sample
output
SLO1
10%
|
All outputs match sample output perfectly, or only one minor difference, e.g., wording, spacing. |
Multiple differences (e.g., typos, spacing, formatting) in program output compared to sample output. |
No reasonable attempt made to match sample output. Very many differences. |
||
Identifier naming
SLO1
10%
|
All function, variable and constant names are appropriate, meaningful and consistent, following style guide. |
Multiple function, variable or constant names are not appropriate, meaningful or consistent, not following style guide. |
Many function, variable or constant names are not appropriate, meaningful or consistent, not following style guide. |
||
Use of code
constructs
SLO1, 2
15%
|
Appropriate and efficient code use, including good logical choices for data structures, decision and repetition structures, good use of constants, as taught in the subject. |
Mostly appropriate code use but with definite problems, e.g., unnecessary code, poor choice of data structures, decision and repetition structures, limited use of constants. |
Many significant problems with code use. |
||
Use of functions
SLO1
10%
|
Functions and parameters are appropriately used, functions are well reused to avoid code duplication, functions follow SRP well. |
Reasonable but not good use of functions, e.g., poor parameter choices, function choices don't follow SRP well, too much low-level detail in main. No functions used or functions used very poorly. |
Any use of global variables. |
||
Formatting
SLO1
5%
|
All code formatting is appropriate, including correct indentation, horizontal spacing and consistent vertical line spacing. PyCharm shows no formatting warnings. |
Multiple problems with code formatting reduce readability of code. PyCharm shows formatting warnings. |
Readability is poor due to code formatting problems. PyCharm shows many formatting warnings. |
||
Commenting
SLO1
10%
|
Meaningful docstrings for all functions, appropriate block/inline comments, top docstring and README are complete. |
Missing function docstrings, noise comments or missing block/inline comments, details missing from top docstring or README. |
Commenting is very poor either through having too many comments (noise) or too few comments. |
||
Use of version
control
SLO3
10%
|
Git used well (local first, not on GitHub directly), good number of commits with good messages that demonstrate incremental code development including appropriate "small milestone" commits. |
Aspects of the use of version control are poor, e.g., not many commits, meaningless or repeated messages, evidence of direct GitHub website edits or uploads. |
Git/GitHub not used at all. |