Assignment title: Information
CSIT111 © Mark Sifer 2016
CSIT111/CSIT811 - Programming Fundamentals
Assignment 3 (due in week 12 & 13)
Standard Level
In this assignment you will 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.
Note the test methods do not require the user console.
Advanced Level (CSCIT811 students must complete this level)
The advanced level includes all the requirements of the standard level plus the following features:
- unlimited remove last item scanned
- the ItemTable class uses a HashMap appropriately.
- grouping of items on the reciept. If the user scans milk three times (at $1.50 each) (not necesarily one after
the other) the reciept should print:
3 Milk 4.50
so the first column in the reciept is a count for that kind of item.
CSIT111 © Mark Sifer 2016
Marking (CSIT111 students)
Advanced (up to 6 marks)
Must be marked in the week 12 lab. Your work must be ready for marking 30 minutes after the start of the
laboratory. You work is likely to be audited, that is, you will be asked to modify and/or explain your code.
Your code is expected to be well structured and easy to read.
Standard (up to 4 marks)
Must be marked in the week 12 or 13 lab. Your work must be ready for marking 40 minutes prior to the end
of the laboratory. You work may be audited, that is, you may be asked to modify and/or explain your code.
Your code is expected to be well structured and easy to read.
Marking (CSIT811 students)
Advanced in week 12 (up to 6 marks)
Your work must be ready for marking 30 minutes after the start of the laboratory. You work is likely to be
audited, that is, you will be asked to modify and/or explain your code. Your code is expected to be well
structured and easy to read.
Advanced in week 13 (up to 4 marks)
Your work must be ready for marking 30 minutes after the start of the laboratory. You work is likely to be
audited, that is, you will be asked to modify and/or explain your code. Your code is expected to be well
structured and easy to read.
You must submit your Java project (zip your project directory) via the eLearning site (the assignment 3
drop box) once you have been successfully marked in the laboratory.