This paper provides a design and develop a system in Java to simulate the operation of a simple supermarket checkout. The main theme of the paper is to analyze and develop a model representing supermarket checkout. As an example, this paper provides the analysis of queuing system for the empirical data of checkout service of super market.
Project Specifications
The purpose of this project is to simulate a simple supermarket. We will first describe the project briefly and then give the details of the classes that you will need to write. Our supermarket has the following features:
All the items in the supermarket (called the inventory) are kept in a file in your current folder. We will supply you a fragment of a java class that will help you to read this file from the disk. The file has a very simple format. Each line contains the name of the item and how many pieces of the item exists in the inventory. For example,
Baked Beans £0.35 per tin
Cornflakes £1.00 per packet
Sugar £0.50 per packet
Tea Bags £1.15 per packet
Instant Coffee £2.50 per jar
Bread £1.25 per loaf
Sausages £1.30 per packet
Eggs £0.75 per half dozen
Milk £0.65 per carton
Potatoes £1.00 per kg bag
Each customer (or shopper) randomly buys a few items from the inventory, however, each customer always buys 50 pieces of the item she chooses (e.g., 50 potato, 50 cheese etc.). A customer may also leave the store without buying anything.
Customers also have another role. If a customer wants to buy an item (50 pieces) and currently there are less than 50 pieces of that item in stock, the customer makes the total available pieces of that item equal to 100 (she adds the remaining pieces). This of course is unrealistic, but we make this by simplifying assumption. You can assume that the customer requests a staff of the super market to add those remaining pieces. If this happens, we say that the customer "re-stocks" the item. A customer does not buy the item that she re-stocks. However, she can buy that item if that item comes up next time when she generates a random number.
A report of a customer's activities (buying items, re-stocking items etc.) is printed using the System.out.println statement (BlueJ pops up a separate window whenever you use the System.out.println statement). A customer can buy the same item repeatedly and also may leave without buying anything (it all depends on the generated random numbers).
Details of the classes
You will need five classes to implement the project. While it is possible to write the project in many different ways, you have to follow these guidelines strictly. The guidelines have been designed deliberately so that you have to pass references (of objects) among objects that are instances of different classes. These classes are discussed below: (Note: I have changed the names of the classes by changing the first letter of each name to upper-case from lower-case (on October ...