Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve this wothout using any java collections library Everything should be solved from scractch and implement the best strategy and explain throughly each step and

Solve this wothout using any java collections library
Everything should be solved from scractch and implement the best strategy and explain throughly each step and why used in terms of time complexity or space
Dont make the code too complex so the teacher wont suspect
Note: this practical must be completed using the materials from units 1-8. You may not use the Java collections library, as introduced in unit 9.
You have been asked to implement a Loan Item System for a local library, which they can operate manually. In this assignment, you will create a prototype system with limited functionality and explain how you have implemented the system in a short design document. The library contains various items for loan: books, magazines, DVDs and CDs. These items have attributes: all have a title and a library ID number. Books and CDs have an author/artist, whereas magazines and DVDs instead have a publisher. All items are kinds of loanable item, which have two further attributes: a flag to indicate if the item is on loan, and a target return date.
Task 1: Decide on a set of fields and data types for the various attributes described above, e.g. the target return date could be represented as a string in the format YYMMDD. Organise the fields between Java classes and/or interfaces to represent each of LoanItem, Book, Magazine, DVD, and CD. Implement these in code, with appropriate accessors or mutators. (20%)
Task 2: Decide on a data structure to hold the librarys collection of items. You will also need to support sorting of the items. You may like to read ahead to decide what properties your data structure and sorting technique require. In your design document justify your choices (e.g. in terms of features, ease of use, computational complexity, etc). Using a test class, create a test collection for the library of 20 items using your chosen data structure. Populate this collection with actual examples, e.g. for a book: author Tolkien, title The Hobbit, library id Item-1, on-loan? No, return-date 000000.(15%)
The library needs to be able to see its collection printed out as a report. The report must show the library id, the items type (i.e. if it is a book, magazine, DVD or CD), the items title, if it is on loan and, if so, what its return date is. The items in the report must be sorted.
Task 3: Provide a method for sorting the items in your data structure. Write a method which sorts the items into the format described below, and another method to print out the report. Demonstrate these methods and provide some tests to prove that they work correctly. (20%)
The items should be displayed in library ID number order, as in this sample report:
Item-1, Book, The Hobbit, no
Item-2, CD, Greatest Hits, yes, 210215
Item-3, Magazine, Astronomy Now, yes, 210210
Item-4, DVD, Pride and Prejudice, yes, 210210
Task 4: Modify your prototype so that the report orders items so that the on-loan items are listed before those not on loan. The on-loan items must be listed in target return date order, and, for items due on the same date, ordered in library ID number order. Provide suitable tests and demonstrate the output report is correct. (If you complete this task, comment out but keep the code implementing task 3, where it conflicts with answering task 4, but make sure both answers are covered in your report.)(10%)
A sample report for task 4:
Item-3, Magazine, Astronomy Now, yes, 210210
Item-4, DVD, Pride and Prejudice, yes, 210210
Item-2, CD, Greatest Hits, yes, 210215
Item-1, Book, The Hobbit, no
Task 5: Provide methods so that the librarians can add or remove items from the collection. When removing an item, they will first need to find it. Depending on your choice of data structure, you may need to add additional methods to support these operations. Provide suitable tests and demonstrate the operations work as they should. (30%)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions