EMATM0048

Software Development: Programming and Algorithms (SDPA)

Resit Coursework Assessment


Part 1: Software Development (40%)

This part is to build a library system using Object-Oriented Programming. The system should be modelling a library management system, where a member can take out and return books. The library can lend, and update the collection (when a member return books)

● Your library has a various book to borrow. These rules apply for borrowing:

● When a book is not borrowed it is available to customers to borrow.

● Once a book is borrowed, the book is assigned to the member and removed from the library catalogue.

● When the book is returned by the member, it is assigned back into the catalogue.

● Library catalogue contains a list of books. People search them to find books using certain criteria, such as with specific titles, or by a particular author. Books can be uniquely identified by an International Standard Book Number (ISBN).

● When borrowing a book: Prompt the member to ask about ISBN or other information about the book, and the number of days he would like to borrow the book for. Check the catalogue for availability. If available, display the following message (or something similar) to the customer: “You have borrowed one book with title { } , {ISBN} for {} days. Update the Catalogue accordingly.

● Upon returning a book:

● Update the catalogue and issue a receipt with more details.

● Print a receipt with information.


Step 1: Create your classes

Your program should have at least three classes as follows:

● Member(s) class: A member is identified as person who can borrow/return books. It will contain data like ID, name, totalCheckedOutBooks etc. The class can:

● Inquire about available books by ISBN or title.

● Request to borrow a book.

● Return a book they have previously borrowed.

● Library class contains the list of books. This class can:

● Display available books in response to member inquiries.

● Process borrowing requests from member after verifying catalogue availability.

● Process returning requests and update the catalogue.

● Book(s) class contains information about the book such as ISBN, author, number of available copies.

Since classes are used, various numbers of customers/books can be instantiated as needed.


Step 2: Run your code

Create the main script (main.py) to run the classes you implemented. Import your classes into your main script. When run, main.py should output a series of prompts to the console, which allows the user to interact with your classes. Your implementation should include the following:

● Create instances of your classes. Initiate the library catalogue with, for instance, 10 books using at least the following: ISBN, Title, Author, Number of copies.

● Perform different transactions to borrow and return.

● Display the catalogue after each transaction.

● Issue receipts for members when returning books.


Step 3: Unit test and exceptions handling

Initially, you may wish to assume that all user input is error-free. In this step, you will need to change your code to handle possible errors. Most errors occur in Null values, negative values, and non-integer inputs. Make sure you handle these errors with the right exceptions. Examples of errors to be handled:

● Requests to borrow a book for an invalid time-period, such as a negative number of days.

● Borrow a book with invalid parameters.

● Return a book which is not initially borrowed.

To test your code, you will need to write a unit test script, “library_test.py” using python built-in unit testing. Verify your classes and methods and validate that the returned values match what you expected.


Part 2: Algorithm Analysis (20%)

Write a modified version of bubble sort to print k largest elements in a list. Elements of the list can be of any order.

Examples:

Input:

List= [12, 3, 6, 4, 10, 30, 54, 8, 14]

K= 3

Output:

Your program should print 30, 54, 14 (in any order)

Explain your algorithm using comments and Jupyter notebook markdown cells, then answer the following questions, you will need to explain your answers in detail with reference to complexity of different parts of your code:

● What is the complexity of this sorting algorithm?

● How is the complexity affected if the list size is less than k?


Part 3: Data Analytics (40%)

Step 1: Find and use data about Bristol

Select a dataset to explore from https://opendata.bristol.gov.uk/pages/homepage/

Explain in markdown cells: which dataset are you choosing? What are the variables of interest?


Step 2: Perform data preparation & cleaning

● Load the dataset into a data frame using Pandas

● Explore the number of rows & columns, ranges of values, etc.

● Handle missing data, if any.

● Perform any additional steps (parsing dates, creating additional columns, etc.)

Explain in markdown cells: steps to prepare, clean your data


Step 3: Perform exploratory analysis and ask questions

● Explore your data, examples are as follows:

● Compute the mean, sum, range, and other interesting statistics for numeric columns

● Explore distributions of numeric columns using histograms etc.

● Explore the relationship between columns using scatter plots, bar charts, etc.

● Ask at least 3 interesting questions about your dataset.

● Answer the questions either by computing the results using Numpy/Pandas or by plotting graphs using Matplotlib. Perform grouping/aggregation wherever necessary

Explain in markdown cells Outline in detail your entire analysis. Explain your insights clearly. You should include a short description of what the intent /interpretation of each plot is.


Step 4: Summarize and write a conclusion using markdown cells

● Write a summary of what you've learned from the analysis

● Share ideas for future work on the same topic using other relevant datasets/sources


-------------------------------------

Submitting your coursework

While completing your coursework, you will be responsible for creating and maintaining a private repository on Github, tracking all progress made on your project using the version control implementations. All work product should be reflected in the repository.

Your submission must include your code for each part: part 1, part 2, part 3.

● Part 1: Includes different Python files for implemented classes, in addition to main.py and library_test.py described in Part 1. Both py and ipython are acceptable for this part.

● Part 2: Jupyter Notebook file to implement and run the sorting algorithm. Answer the questions in the markdown cells.

● Part 3: Jupyter Notebook file that includes code and explanation in the markdown for each step. The collected data saved in Step 1 must be submitted too.

● GitHub markdown (.md file): to explain any required instructions for running your code.

● If you have used any additional code, beyond standard Python packages, then you will need to include an additional subdirectory containing additional code required to run your scripts. The authorship of any such code should be clearly stated in GitHub markdown.

For submitting your work on Blackboard, you will need to submit a zip file with the name (“UOBusername_EMATM0048). Your zip file should contain the latest version of your GitHub repository along with a text file of your GitHub repository link. You will need to add "SDPA-UoB" as a collaborator to your repository. Please note you must NOT change in your remote repository once you added SDPA-UoB as a collaborator.


-------------------------------------

Grading

Your grade will be assessed on both correctness and style.

● Correctness: How well the program works according to specifications. How good is the quality of your analysis?

● Style: The quality of the code and documentation.

Your code should be well-written and well-commented. You are encouraged to format your code in accordance with Python style guidelines. It should be clear enough for another programmer, such as the course staff, to understand and modify if needed. Quality code is expected to meet our style requirements:

● Every function written is commented, in your own words, using a doc-string format that describes its behavior, parameters, returns, and highlights any special cases.

● There is a comment at the top of each code file you write with your name, section, and a brief description of what that program does.

● All requirements for each of the parts are met.