ISOM3028 - Advanced Computer Programming

ISOM3028 - Advanced Computer Programming

2025/2026

Section 002

 

 

Assignment 1&nbspDue Date: 21 March, 2025 (IN CLASS)

___________________________________________________________________________

 

Note: Submit both hardcopy (printed format) and softcopy.

 

  1. For hardcopy, you are required to submit program listing, documentation, sample inputs and outputs. Documentation includes program description, function description, variable description and statement description. Inside program description, you need to mention the author name, i.e. your name, and student no.

 

  1. For softcopy, please compress all the class and program filesand send the compressed file through UMMoodle. Save your compressed file as “bc1xxxx_Ass1.zip”. Please remember to use your student number as part of compressed file name.

 

You are required to create an Book Management System for a book store. The system should allow the user to add new books, retrieve book information, update book information and display book information in the system.

Instructions:

  1. Create a class named "Book" with the following attributes:
  • isbn (String): unique identifier for each book
  • bookTitle (String): name of the book
  • category (String): book category name
  • author (String): author name of the book
  • publisher (String): publisher name of the book
  • pubDate (LocalDate): publication date of the book
  • price (float): current price of the book
  • stock (int): current stock level of the book

 

  1. Implement a constructor in the "Book" class that initializes all the attributes based on a parameter list.

 

  1. Implement the set and get methods for all the data fields mentioned above.

 

  1. Create a class named "BookManagementSystem" to manage the books. This class should have the following methods:
  • addBook(String isbn, String booktitle, 代写ISOM3028 - Advanced Computer ProgrammingString category, String author, String pub, String pub_date, float prc, int stock): Adds a new book to the system.
  • findBook(String isbn): Retrieves book info. based on the isbn.
  • changePrice(String isbn): Change book price based on isbn.
  • increaseStock (String isbn): Increase stock level based on isbn upon stock arrival.
  • displayBookList(String category): Displays all information of books based on a certain category.
  • deleteBook (String isbn): Deletes a book from book list based on isbn.

 

  1. Implement the "addBook" method in the "BookManagementSystem" class that creates a new "Book" object and adds it to a collection (e.g., ArrayList) of books.

 

  1. Implement the "findBook" method that searches a book based on isbn and returns the book object if it is found; otherwise returns null value for the book object.

 

  1. Implement the “changePrice” method that will change price based on isbn. It will display book title, isbn, category, author & publisher and ask user for the new price. It will update the new price of the corresponding book in the ArrayList.

 

  1. Implement the "displayBookList" method that iterates through the collection of book list based on a specific category and displays their information on screen. (Note: Publication Date should be displayed as dd-MMM-yyyy)

 

  1. Implement the “deleteBook” method that deletes a particular book from the book list based on isbn. It will display the information of the target book and then ask user for confirmation. If user confirms with ‘y’, the target book will be deleted from book list.

 

  1. Create a main method in a separate class to test your Book Management System. In the main method, create an instance of the "BookManagementSystem" class and display the following menu containing four functions and the system will ask the user to input a menu item to execute a particular function:

 

posted @ 2025-03-29 19:43  OHIOT  阅读(12)  评论(0)    收藏  举报