Enhanced POS Application (Knowledge of GUI and Simple Threads included)
- OBJECTIVE You are required to implement a graphical user interface (GUI) version for the point of sale (POS) application similar to that in assignment 1. The objective of assignment 2 is to practice skills in GUI and multi-threaded programming.
- TASKS There are three implementation tasks in this assignment, which are the logic, GUI and multi-thread part. The details are listed as follows. LOGIC Part: In addition to the basic functionalities mentioned in Assignment 1, the POS application allows a store to offer discounts to its customers. There are four types of discounts:
- Event discount: The store may offer an event discount on a special day. All purchases on that day can enjoy a specified discount.
- Customer discount: Purchases made by a customer who is a club member of the store can enjoy a specified discount.
- Product discount: Purchases of a product under promotion can enjoy a specified discount.
- Sales discount: Purchases of products may enjoy a specified discount if their total amount (before discount) is greater than a certain value. Let’s mark the event discount ratio as e, the customer discount ratio as c, the product discount ratio as pi for a purchased product Pi and the sales discount ratio as s when total payment exceeds R, then the total amount of payment is calculated by: (1) If the total payment exceeds R (Price1*(1-p1) + Price2*(1-p2) + Price3(1-p3)…..) * (1-c) * (1-e)(1-s). (Pricei is the corresponding price of the purchased product Pi.) (2) If the total payment does not exceed R (Price1(1-p1) + Price2*(1-p2) + Price3(1-p3)…..) * (1-c) * (1-e). The enhanced POS system reads various discount information from the file conf.xml. For example, you can find the following contents in the file conf.xml under the directory “configure”: