












































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













































Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Submission date March 9th^ ,2022 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyen Duc Quang Student ID GCH Class GCH0908 Assessor name Dinh Duc Manh Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Quang Grading grid Grade (0-10)
Grade: Assessor Signature: Date: IV Signature:
Currently, the use of books to look up information as well as entertainment at my library is increasing. This leads to manual library management which makes it difficult, delayed and impossible for us to control the right amount. Therefore, I decided to create an application that supports book management in java language. This application helps me to know the exact information of the book and control its price and quantity.
The java program that I created helped me solve some of the following problems:
The first is the initialization method. I use this method to initialize the objects I declared above. This helps me to initialize values for properties inside it and helps me to call other corresponding methods to initialize the logic inside the objects. I then apply java's encapsulation through getter and setter methods to define accessibility for the private properties I initialized above and allow those properties to be viewed and modified.
I apply java’s inheritance to this class. Through calling hashCode() method I will get the hashcode value of the above initialized elements. Combined with that, I use the equals()) method to semantically compare two objects (by comparing the data members of the class).
In the bookManagement class, I have declared properties like file (for file read and write functionality), a new List named bookList which is linked from the Book.java class that I created, a memory variable which is model to use Used for information display function, two integer variables index and editIndex are used to
display and interact with information. Then I instantiate a new method called bookManagement , which contains the values of the properties created above. I will use them to pass values to the methods and functions below. I initialize the thongke array with the function of displaying the information printed under the labels Total, Borrowed, BorrowedCost , used to calculate the total number of books, the number of books to borrow and the amount of books to be borrowed.
in the writeFile array with the input bookList variable, I initialize 2 variables fileOutputStream and outputStream with the initial value of null. I use try ... to catch the exception through which to pass the value of the initialized file variable into this method. I use a for loop so that every time a value is added to memory, the writeObject method with the variable b as bookList will be executed. In the catch part, I leave
the conditions printed to the screen as unsatisfactory. I end the method with finally with another try..catch exception method to remove unsatisfied conditions Similarly, in the readFile array with the input bookList variable, I initialized 2 variables fileInputStream and inputStream with the initial value of null. I use try ... to catch the exception through which to pass the value