Bookstore Purchasing System
UST wants to set up a system whereby customers can order books from the bookstore on line. Customers will be able to run the program and enter what books they’d like to purchase. The bookstore employees would receive this order, collect all the books ordered and package them up for the customer to pick up. The system will calculate the time it will take to put together the order and let the customer know the total cost and how long to wait to go pick up their order. Initially, customers will be able to order textbooks and novels only.
The Java system will be an application using a character based interface (no JFrames or Applets). It needs to be designed with an eye toward use of polymorphism and inheritance. The user interface should be written in such a way that it can be easily replaced in the future with a GUI. All checked exceptions should be handled through try and catch blocks with finally blocks used where appropriate. The system needs to create an exception object to be thrown when an order has any incorrect data.
There will be a file provided with the data for the books. This data will include author, title, ISBN number, cost, time to “pick” (get the book), and type (textbook or novel). The program should read this file, create book objects and store those book objects in a bookstore collection class. This collection class should then be written out to disk. When the program runs again, it will need to check to see if the collection object is in the local directory. If it is it will read that object. If it isn’t it will read the text file and recreate the collection class object.
Keep a “queue” whereby the orders are entered and their status kept. Initially, the order status would be received, then it would change to in-process, and then finally change to completed. When the order is received, start a thread whereby you simulate the time it takes to complete the order – one minute will equal one second. When the thread starts it will change the order status to in-process and when it is done, it will change the order status to completed. Display appropriate messages on the screen when these things occur.
Here is a link to the data file mentioned above: books.dat
Here is a link to the UML Static Structure Diagram: UML Static Structure
Here is a link to a .zip file containing all the instructor code and the database: Bookstore Code and .mdb Database