Build a Grocery Warehouse Management Systems to mange customers, orders, and inventory levels.
What you must know in order to complete the project
- Classes with instance variable and methods
- How to implement a design using OO Concepts such as: Polymorphism, Encapsulation, and Composition
- Abstract classes
- Error Handling
- GUI Design and Layout Managers
- Swing event handling (ActionListeners)
- File I/O
How to use
The build process creates Warehouse.jar in the root folder. You can run this by double-clicking it!
Suitable for advanced students. Would be 20-40 hours of work when material is covered well.
The specification is quite verbose and some choices are forced, this makes it difficult to do things in a natural way. So, this makes it a bit easier in some ways (less decisions), but harder in other ways!
The first step is to clarify the specifications from the assignment document ( /design/warehouse assignment.doc).
- There are two types of Customer:
A) A Retailer has a line of credit with the grocery warehouse against which they can purchase their orders - any balance owning on their line of credit from the Retailer’s last order must be paid off before a new order can be placed.
B) Outlet Members must pay immediately for the items they are purchasing
- there are no fixed limits on the amount of stock that is available for purchase to Outlet Members
- Outlet Members can get reward points for each for each $10 spent in a single transaction. The points earned from a transaction are calculated based on the total purchase amount before any applicable discount is applied.
- Discounts are given depending on the reward points accrued:
|Total Reward points accrued||% discount|
- Implement a Customer abstract class with:
- A) properties that are common to both types of customer: customer id, name, address, phone number
- B) an (abstract) method for adding a sale to the customer’s “account”.
- Implement a Retailer subclass with:
- A) an additional property representing their current credit balance (amount owing from their last order)
- B) override the abstract method for adding a sale in the Retailer class - this method should check to see if there is any amount owing from the previous order before adding the new order total to the Retailer’s credit balance – if there is still an outstanding credit balance from the previous order then an exception containing a suitable error message should be thrown (and caught in the application class).
- C) a new method which allows the credit balance (amount owing) for the retailer to be reset to zero (0) to reflect that payment of any amount owing from the Retailer’s last order has been made.
- Implement an OutletMember subclass with:
A) an additional property representing the total reward points accrued.
B) override the abstract method for adding a sale in the OutletMember class - this method will involve adding reward points to their accrued reward point total based on the total sale amount of their current transaction – if the OutletMember’s reward point total reaches the a higher discount level after the reward points for the current transaction have been added the an exception containing a suitable congratulatory message should be thrown (and caught by the application class).
C) You should also implement a method for retrieving the customer’s current discount percentage (based on their accrued reward point total).
The input text files that are used to save and load the data can be found in the folder: /files .
See folder: /design
Use JTabbedPane to separate functionality.
As the layout is coded manually, the simplest layout managers are used: flow; border, and box.
See folder: /doc