Assignment title: Information
Complete your implementation of a supermarket self-checkout. In particular you must now use a Java collection such as ArrayList, rather than long sequences of if-else statements where possible. The ItemTable which converts a bar code to a name and a price should use a collection/s that is created when the ItemTable object is created i.e. in it's constructor. The getName and getPrice methods should then access this collection/s to find the respective name and price. In more detail: Place the code that builds the list/lists needed for name and price lookup (using the barcode) in the ItemTable constructor. I recommend that you create another class called ItemType (a bar code, name and price), so that your ItemTable contains an ArrayList of ItemTypes. Then in the ItemTable constructor you will create at least 10 ItemType objects, then place them into the list of ItemTypes. The ItemTable methods getName and getPrice will then need to search this list of ItemType objects to convert barcodes to names and prices. The Machine object will also need to contain a collection so that the final reciept can be printed. There are a few choices for this collection. Finally the user will be able to operate the program from the Console, which will prompt the user to: - start a scan - scan items, entering the bar code each time - end the scan and print the bill A reasonable selection of test methods i.e. an empty basket, a basket with one item, a basket with multiple items with the same bar code, a basket with a mix of items including multiple items with the same bar code