For this homework, you will be building a Library Management System, that will help managing and acquiring data about the books that are being used by students.
Let's walk through the details of the homework:
Four main classes are necessary to complete this homework.
These classes will be called Author, Book, Student and Issue.
Book class
This class will have:
- Variable called
isbn
of data typestring
, representing the International Standard Book Number and acting as the unique identifier for the table book (Private member) - Variable called
title
of data typestring
(Private member) - Variable called
category
of data typestring
(Private member) - Variable called
quantity
of data typeinteger
(Private member) - A parameterized constructor that takes
isbn
,title
,category
and aquantity
- Public Getter functions to access these variables
- Public Setter functions to change these variables
- Optional attributes are accepted if needed based on the code structure
Author class
This class will have:
- Variable called
authorId
of data typeinteger
, auto-incremented (Private member) - Variable called
name
of data typestring
(Private member) - Variable called
email
of data typestring
(Private member) - Variable called
authorBook
of data typeBook
, representing a One-to-One relationship withBook
(Private member) - A parameterized constructor that takes
name
,email
andauthorBook
- Public Getter functions to access these variables
- Public Setter functions to change these variables
- Optional attributes are accepted if needed based on the code structure
Issue class
This class will have:
- Variable called
issueId
of data typeinteger
, auto-incremented (Private member) - Variable called
issueDate
of data typestring
(Private member) - Variable called
returnDate
of data typestring
(Private member) - Variable called
issueStudent
of data typeStudent
, representing a One-to-One relationship withStudent
(Private member) - Variable called
issueBook
of data typeBook
, representing a One-to-One relationship withBook
(Private member) - A parameterized constructor that takes
issueDate
,returnDate
,issueStudent
andissueBook
- Public Getter functions to access these variables
- Public Setter functions to change these variables
- Optional attributes are accepted if needed based on the code structure
Student class
This class will have:
- Variable called
usn
of data typestring
, representing the Universal Student Number and acting as the unique identifier for the table student (Private member) - Variable called
name
of data typestring
(Private member) - A parameterized constructor that takes
usn
andname
- Public Getter functions to access these variables
- Public Setter functions to change these variables
- Optional attributes are accepted if needed based on the code structure
After starting this application, a list of options will pop up for the user. The user will be asked to input a number based on the list of options displayed, such as adding a book, searching for a book, issuing a book for a student, etc. After a certain action is executed, the menu is re-displayed for the user automatically.
The menu should have the following options:
- Add a book
- Search book by title
- Search book by category
- Search book by Author
- List all books along with author
- Issue book to student
- List books by usn
- Exit
- Add a book: This action is responsible of adding a book and its author in the system. The user will be prompted to enter the details of both the book and the author in the following format:
Enter your choice: 1
Enter isbn : 978-3-16-148410-0
Enter title : The Notebook
Enter category : Romance
Enter Author name : Nicholas Sparks
Enter Author mail : [email protected]
Enter number of books : 4
- Search book by title: This action is responsible for searching a book by title.
Enter your choice: 2
Enter title : The Notebook
Book ISBN Book Title Category No of Books
978-3-16-148410-0 The Notebook Romance 4
- Search book by category: This action is responsible for searching a book by category.
Enter your choice: 3
Enter category : Romance
Book ISBN Book Title Category No of Books
978-3-16-148410-0 The Notebook Romance 4
- Search book by author: This action is responsible for searching a book by author name.
Enter your choice: 4
Enter name : Nicholas Sparks
Book ISBN Book Title Category No of Books
978-3-16-148410-0 The Notebook Romance 4
- List all books along with author: This action is responsible for listing all the books available and there corresponding authors.
Enter your choice: 5
Book ISBN Book Title Category No of Books Author name Author mail
978-3-16-148410-0 The Notebook Romance 4 Nicholas Sparks [email protected]
978-3-17-148410-0 Da Vinci Code Mystery 5 Dan Brown [email protected]
- Issue book to student: This action is responsible for creating a student and issuing him/her the specified book. The date issued represent the current date and the return date should be after 7 days.
Enter your choice: 6
Enter usn : 09003688800
Enter name : John Doe
Enter book ISBN : 978-3-17-148410-0
Book issued. Return date : Mon Aug 01 19:45:40 EEST 2022
- List books by usn: This action is responsible for listing all books rented by the specified student.
Enter your choice: 7
Enter usn : 09003688800
Book Title Student Name Return date
Da Vinci Code John Doe 2022-08-01 16:45:40.636000
For this project, you must accomplish all of the following:
- Navigate through a text-based menu using Standard Input and Output.
- Create unit tests for every method other than basic getters, setters and constructors (getters and setters with logic do require unit tests).
- Handle all exceptions gracefully (incorrect input should not crash the program).
- All data should be stored in a normalized SQL database.
- Add more options that can help display more information such as List books to be returned today, etc.
- Everyone in the squad should contribute equally to the project in time and lines of code written.
- All code must be reviewed before it is merged into the
master
branch. - All squad members must participate in code review.
- Every repository should have a README file with clear instructions, demo files, or any documentation needed so other teams don't have problems with the review.
- This is intended to be a challenging assignment. You will have to rely heavily on your teammates and independent research. Learning independently is a hallmark of a good developer and our job is to turn you into good developers. This process may be frustrating but you will learn a ton!