Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Final Coding Challenge
Assessment Type |
Individual assessment (no group work). Submit online via Canvas/Assignments/Final Coding Challenge. Marks are awarded per rubric (please see the rubric on Canvas). Clarifications/updates maybe made via announcements. Questions can be raised via the Canvas discussion forum.
|
Due Date |
End of Week 14 (exact time is shown in Canvas/Assignments/Final Coding Challenge) Deadline will not be advanced nor extended. Please check Canvas/Assignments/Final Coding Challenge for the most up to date information regarding the assignment. As this is a major assignment, a university standard late penalty of 10% (i.e., 3 marks) per each day applies for up to 5 days late, unless special consideration has been granted. |
Weighting |
30 marks out of 100 |
1. Overview
The main objective of this final project is to assess your capability of program design and implementation for solving anon-trivial problem. You are to solve the problem by designing a number of classes, methods,code snippets and associating them towards a common goal. If you have questions, please ask via the relevant Canvas discussion forums in a general manner; for example, you should replicate your problem in a different context in isolation before posting, and you must not post your code on the Canvas discussion forum.
2. Assessment Criteria
This assignment will determine your ability to:
i. Follow coding, convention, and behavioural requirements provided in this document and in the course lessons;
ii. Independently solve a problem by using programming concepts taught in this course;
iii. Design an OO solution independently and write/debug in Python code;
iv. Document code;
v. Provide references where due;
vi. Meet deadlines;
vii. Seek clarification from your "supervisor" (instructor) when needed via the Canvas discussion forums; and
viii. Create a program by recalling concepts taught in class, understand and apply concepts
relevant to solution, analyse components of the problem, evaluate different approaches.
3. Learning Outcomes
This assignment is relevant to the following Learning Outcomes:
1. Analyse simple computing problems.
2. Devise suitable algorithmic solutions and code these algorithmic solutions in a computer programming language (i.e., Python).
3. Develop maintainable and reusable solutions using object-oriented paradigm.
4. Assessment Details
Please ensure that you have read Sections 1-3 of this document before going further.
Problem Overview: In this final coding challenge, you are asked to develop a Python program with the Object-Oriented Programming paradigm, named my_record.py, that can read data from files and perform. some operations. You are required to implement the program following the below requirements. Note that we will give you some files for you to run with your developed program, BUT you should change the data in these files to test your program. During the marking, we will use different data/files to test the behavior. of your program.
Requirements: Your code must meet the following functionalities, code, and documentation requirements. Your submission will be graded based on the rubric published on Canvas. Please ensure you read all the requirements and the rubric carefully before working on your assignment.
A - Functionalities Requirements:
There are 4 levels, please ensure you only attempt one level after completing the previous level.
------------------------------------------- PASS LEVEL (15 marks) --------------------------------------
Your project is to implement the required functionalities in the Object-Oriented (OO) style with at least three classes: Records, Book, and Member. You need to design appropriate static/instance variables, constructors, and static/instance methods in these classes. The class related info should be encapsulated inside the corresponding class.
At this level, your program can read data from the record file specified in the command line, which stores the number of days various books have been borrowed by some members of a library (record file). Your program should create a list of Book objects, a list of Member objects, and a variable (you can think carefully about which data type to use) to store these number of borrowed days. You should design the classes properly so that these actions can be encapsulated within the appropriate classes. Note that, at this level, we only know the IDs of the books and members. These IDs are all unique.
In the main class, your program should create a Records object, call its method read_records(record_file_name) to load all the data from the record file, and then call the display_records() method to display the number of days all the books have been borrowed in the required format (as specified in the following).
Below is an example of the file that stores the number of days all the books have been borrowed by all the members of the library – see the next page. The data fields in this record file are separated by commas, colons, and new lines. Each row contains the book IDs, and the number of days the books have been borrowed by the members of the library. The format of each row is always book_ID, member_1: num_days_1, member_2: num_days_2, … When the member only reserves the book but hasn’t taken it yet, the data field after the colon corresponding to the member will be R. For example, in our record file example, the book B01 has been borrowed for 7 days by the member M01,has been reserved by the member M03, and has been borrowed for 2 days by the member M06. The book B03 has been borrowed for 2 days by the member M01, 8 days by the member M02, and has been reserved by the member M05. You can assume there are no duplicate or redundant rows. You can also assume the format of the data in the file is always correct.
Your program should print a message indicating how to run the program if no record file is passed in as a command line argument. Otherwise, it can display a table showing the number of days the books have been borrowed by the members of the library, and two sentences showing the total number of books and members, and the average number of days the books have been borrowed. In the table, if a book is not borrowed or reserved by a member, then the data field at that location has an ‘xx ’ symbol. On the other hand, if the book has been reserved by a member, the data field at that location is shown as a double dash (--). Also, the data in the columns in the table are aligned, in particular, the member IDs are aligned to the left whilst the records (the number of borrowing days) are aligned to the right.
The printed messages corresponding to two scenarios need to be exactly as below:
1. This is when no record file is passed in as a command line argument.
2. This is when a record file is passed in as command line arguments. Note that users can specify a
different filename, not necessarily the name records.txt.
----------------------- CREDIT LEVEL (3 marks, you must only attempt this level after completing the PASS level -------------------------
At this level, your program can support more information about books. Now, apart from the ID, each book will have a name, type, the number of copies in the library, the maximum number of days it can be borrowed free of charge, and the late charge per each day if it is borrowed more than the maximum free days. All IDs, names, the number of copies, the maximum number of borrowing days, and the late charge can be modified. There are two types of books: Textbook and Fiction. All textbooks have the same maximum borrowing days, which is 14 days by default. The fiction books have different maximum borrowing days, but always be larger than 14 days. When reading the book file, if this requirement is violated for any book, then the program should terminate, and it should also display the message indicating the issue and the corresponding book. You should define appropriate variables, getters, and setters for books.
A book should have a method to compute some useful statistics, e.g., the number of borrowing members, the number of reservations, the range of borrowing days by the members (it is your choice to define the necessary statistics to compute). You can define extra methods if necessary.
At this level, the book file will have more information of the books, includes the book IDs, names, types, the number of copies in the library, the maximum number of borrowing days, and the late charge. You can assume there are no duplicate or redundant books. You can assume all the books available in this file are also available in the record file (in the PASS level), and viceversa.
At this level, your program can now print the book information table on screen and save the book information into a filename reports.txt. For example, given the above record file (in the PASS level) and the book file (in this level), the book information table should look like below. Note the content within the reports.txt file should also look the same.
In this level, users can pass two file names via the command line arguments: the record file and the book file. The program will then display two tables: the record table from the PASS level, and the book information table from this level.