Uploaded by Tuấn Phi Lưu

AS requirements

advertisement
PRO192 - Assignment
Book Management System
using Java ArrayList class
Your assignment for this course is to implement a beginner level Book Management System
(BMS) in Java language. BMS contains 2 classes: Book and BookList. The Book class has the
following attributes:
• code: a String object, that hold the book’s code.
• title: a String object, that hold the book’s title.
• qua: int vảriable, that hold the number of books with the same code in the library.
• price: a double variable, that hold the book’s price.
The BookList class contains only one data member: ArrayList<Book> t. When running the
program display the menu as below:
1. Input & add book(s) to the end.
2. Display all books.
3. Search a book for given code.
4. Update the book’s price for given code.
5. Find the (first) max price value.
6. Sort the list ascendingly by code.
7. Remove the book having given code.
8. Load data from file.
0. Exit.
Notes:
(1) The book’s code must be unique in the list.
(2) Display all books in format (code, title, quantity, price).
(5) Find and return the position of the (first) max value.
(8) Load data from file, replacing all given data.
You can run the AS_sample project to see how the above functions work.
Download