Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IMPORTANT NOTE: IN THIS ASSIGNMENT, YOU ARE NOT PERMITTED TO USE ANY OF THE JAVA BUILTIN CLASSES SUCH AS ArrayLists, LinkedList, HashMaps, etc. Using any

IMPORTANT NOTE: IN THIS ASSIGNMENT, YOU ARE NOT PERMITTED TO USE ANY OF THE JAVA BUILTIN CLASSES SUCH AS ArrayLists, LinkedList, HashMaps, etc. Using any of these will result in zero marks!
you can use the classes String and Scanner.
Description
FunReadings Library is asking you to write a Java program that manages all the items in their library and their leases as well as returns to and from clients. Your program is to be used only by library employees, and not clients. The library has books, journals, and media (for example: DVDs). All items have an ID, a name, author(s), and year of publication. A client has an ID, name, phone number, and
email address. There might be many copies from each item in the library. However, different copies will have different IDs. In general, an items ID is unique.
A journal also has a volume number, a book has number of pages, while a media has a type(audio/video/interactive). Books IDs start with B(e.g. B1, B2,...), journals IDs start with J(e.g., J1, J2...), Media IDs start with M(e.g., M1, M2...). A good menu should be provided so that
the user of your program can perform the following operations:
add an item, delete an item, change information of an item, list all items in a specific
category (book, journal, or media), and print all items (from all categories).
add a client, edit a client, and delete a client.
lease an item to a client and return an item from a client.
show all items leased by a client.
show all leased items (by all clients).
Display the biggest book (see below).
Make a copy of the books array (see below).
Part I: UML
Draw a single UML representation for the hierarchy of the above-mentioned classes. Your representation must also be accurate in terms of UML representation of the different entities and the relation between them. You must use software to draw your UML diagrams (no handwriting/hand drawing is allowed). In case additional classes and/or data attributes are needed to reflect how the above classes are related in real-life, you can add these classes.
Part II: Implementation
1. Implement the above-mentioned classes using inheritance and according to the specifications/requirements stated below:
You must have 3 different Java packages for the classes: the first package will include the driver class, the second package will include the class for client, and the other classes will reside in the third package.
For each of the classes, you must have at least three constructors, a default constructor, a parameterized constructor (which will accept enough parameters to initialize ALL the attributes of the created object from this class) and a copy constructor. For instance, if any of these classes has 7 attributes (including the ID), then the parameterized constructor must accept constructor creates a new object that is an exact copy of the passed object, with the exception of the ID.
An object creation using the default constructor must trigger the default constructor of its ancestor classes, while creation using parameterized constructors must trigger the parameterized constructors of the ancestors.
For each of the classes, you must include at least the following methods: accessors, mutators, toString(), and equals() methods.
The toString() method must return a clear description and information of each object
The equals() method must first verify if the passed object (to compare to) is null and if it is of a different type than the calling object. The method would clearly return false if any of these conditions is true. Otherwise, it compares all the attributes EXCEPT the ID to see if the two objects are equal.
For all classes, you must use the appropriate access rights, which allow most ease of use/acce 6 parameters to initialize all its 6 attributes the ID is set automatically. The copy s without compromising Information Hiding. Do not use most restrictive rights unless they make sense!
When accessing attributes from a base class, you must take full advantage of the permitted rights. For instance, if you can directly access an attribute by name from a base class, then you must do so instead of calling a public method from that base class to access the attribute.
2.Write a driver program (that contains the main() method), which will utilize all of your classes, and trigger the execution of all the methods you have written. You should always keep in mind that if a code is written but never triggered and tested, then it may not work correctly when needed; so, test all your code!
3.Besides the main() method, the driver will also include two more methods:
A method called getBiggestBook(), which, as the name suggests, will find the book with the highest number of pages. If many books have the same highest number of pages, the method can return anyone of them.
call the getBiggestBook() with the array of books and display the result.
Finally, call the method copyBooks()

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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

5. Identify the logical fallacies, deceptive forms of reasoning

Answered: 1 week ago

Question

6. Choose an appropriate organizational strategy for your speech

Answered: 1 week ago