Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CT 7 0 1 Programming Fundamentals Page 1 of 4 Assignment 2 Supermarket Self - Service Checkout This assignment will test your skills in designing
CT Programming Fundamentals
Page of
Assignment Supermarket SelfService Checkout
This assignment will test your skills in designing and programming applications to specification and is worth
of your marks for this course. This is an INDIVIDUAL ASSIGNMENT and while you may discuss it with
your fellow students, you must not share designs or code or you will be in breach of the university
plagiarism rules. This assignment should take you approximately hours to complete.
Assignment Overview
You are tasked with creating a textbased program for simulating a supermarket selfservice checkout using
the Python programming language.
The assignment is broken up into two main
components:
Design and model two classes: Product
and CheckoutRegister,
Create a computer program that allows
a user to interactively check out a
number of products, then provides an
opportunity to enter some virtual money to pay for the products and finally and prints out a receipt for
the user to the screen, not on paper and finally
Your submission should consist of one Microsoft Word or LibreOffice document containing the first part of the
assignment, and three Python scripts that implement the computer program checkoutregisterpy
product.py and main.py
The main.py script runs the main logic of the program and will use instances of the CheckoutRegister and
Product classes to simulate checking out of the supermarket.
Towards the end of this document you will also be provided with the output of a simulated run of the completed
computer program which may help you with this assignment.
Assignment Part Details Class Design
Think of a product that you can buy from a supermarket, like maybe a can of soup or an apple.
Start by listing all the properties of that object that you can think of try to come up with at least ten general
properties of a Product and write these down in your AssignmentPart Microsoft
Word document.
Next, use the process of abstraction to cut the number of properties back to only four key properties write
these down in the next section of your Word document.
Now, fill in the class diagram for your Product class in the Word document. Your product class does not have
CT Programming Fundamentals
Page of
to have any methods ie functions associated with it to perform any actions other than a constructor which
takes and set the four key properties that youve identified.
Next well move on to CheckoutRegister class think about what information the checkout has to keep track
of to allow you to successfully check out of the supermarket. There will only really be three key properties that
the CheckoutRegister cares about, and the CheckoutRegister class should have the following four methods
available:
A default constructor that takes no arguments and initialises a new object and its properties,
acceptpaymentsomeamount
scanitemsomeproduct and
printreceipt
Fill in the class diagram for the CheckoutRegister class in the Word template, and thatsthe first part completed!
Assignment Part Details Software Implementation
You are free to implement the software however you see fit, however the functionality of the software should
be able to match the following output. Note that in the below run of the program I have hardcoded a small
number of Product instancesso that products exist which can they can be checked out in your code you should
do the same.
Your program does not have to have the facility to add new products just define a few and use them as
demonstrated below. If the final option of Next customer is chosen, the program should run again
Example Program Output
Welcome to Xmart checkout!
Please enter the barcode of your item:
Milk, Litres $
Would you like to scan another product? YN y
Please enter the barcode of your item:
Bread $
Would you like to scan another product? YN y
Please enter the barcode of your item:
This product does not exist in our inventory.
Would you like to scan another product? YN n
Payment due: $ Please enter an amount to pay:
Payment due: $ Please enter an amount to pay:
We don't accept negative money!
Payment due: $ Please enter an amount to pay:
CT Programming Fundamentals
Page of
Final Receipt
Milk, Litres $
Bread $
Total amount due: $
Amount received: $
Change given: $
Thank you for shopping at Xmart!
Next customer, or Quit q
Submission and Marking Process
You must supply your program source code files and your document containing the class design and test
cases.
Assignments will be marked on the basis of fulfilment of the requirements and the quality of the work. In
addition to the marking criteria, marks may be deducted for failure to comply with the assignment
requir
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started