Wednesday, December 4, 2019

Simulation of Market

Question: Discuss out the Simulation of Market? Answer: Description: The supermarket checkout simulation is about simulation of checkout of various items in particular market. It accesses the items one by one. It scans the product code of an item. Only valid code passes, when it undergoes the checkout process, other invalid product code marks as invalid. In this simulation, owner can get know which are invalid product code. There can be number of checkouts. But presently, this simulation uses only two checkouts. Classes used in this design: There are two classes used in this simulation. One is Simulation, and other one is Product. Simulation class: It is main class where main() method run the program. This class reads the data from text file and stores into list. This class works as JFrame class. It makes the graphical user interface of simulation. It has number of java components to make the Graphical user interface. There are three labels and Text fields which used to store the description of products (items). The information of text fields is accessed by checkout buttons. There are two buttons which represent checkout 1 and checkout 2. The product can be accessed by any of checkout. There are two text areas. The information of left side text area indicates all scanned items. This text area also shows whether item is passing or not. This checking fully depends upon checkout buttons. The information of other text area tells about which checkout process the item. Moreover, there are number of other labels which tells about special note, item information etc. Product class: This class accesses by simulation class. It uses to store the information product. It has three member variables which stores the product information like product code, description and price. Class diagram: Product Class Product - productCode:String - description:String - price:double + Product() + Product(productCode:String, description:String, price:double) +getProductCode():String +getDescription():String +getPrice():double +setProductCode(productCode:String):void +setDescription(description:String):void +setPrice(price:double):void Simulation Class Simulation -List:ArrayList -codeList:ArrayList -totalProduct:int -scannedProduct:int -unscannedProduct:int -count:int + Simulation() + actionPerformed(ae:ActionEvent):void +checkCode():boolean +updateProductInfomation() ():void +readFile():void +main(args:String[]):void Use case:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.