Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

School of Science, Engineering and Information Technology ITECH1400 – Foundations of Programming School of Science, Engineering and Information Technology ITECH1400 - Assignment 1 – Supermarket...

1 answer below »
School of Science, Engineering and Information Technology    
ITECH1400 – Foundations of Programming
School of Science, Engineering and Information Technology
ITECH1400 - Assignment 1 – Supermarket Self-Service Checkout
Student Name:                            Student ID:
Assignment Part 1 Details – Class Design
Insert your list/table of possible product properties here…
Product Properties (All)
    
    
    
    
    
    
    
    
    
    
    
    
Insert your list/table of key product properties here…
Product Properties (Key)
    
    
    
    
Complete the class diagram of your final Product class here…
Product Class Diagram
CheckoutRegister Class Diagram
Complete the class diagram of your final CheckoutRegister class here…
Assignment Part 2 – Activity Flowchart
Insert your activity flowchart of the supermarket checkout process here… If your flowchart is large then place it on the following page.
Assignment Part 3 – Software Implementation
Do not place your code here – provide the code as separate .py files submitted with this document.
Assignment Part 4 – Code Explanation and Use
Update the below code to insert comments describing what the code is doing – for each line starting with a hash symbol (#) you should write your code comments after the hash. You may add a second line of comments if you require more space.
# Function to: ___________________________
def get_float(prompt):
# ____________________________________
value = float(0.0)
# ____________________________________
while True:
XXXXXXXXXXtry:
# ____________________________________
XXXXXXXXXXvalue = float(input(prompt))
# ____________________________________
XXXXXXXXXXif value < 0.0:
XXXXXXXXXXprint("We don't accept negative money!")
XXXXXXXXXXcontinue
# ____________________________________

eak
# ____________________________________
XXXXXXXXXXexcept ValueE
or:
XXXXXXXXXXprint('Please enter a valid floating point value.')
# ____________________________________
return value
# Function to: ___________________________
def bag_products(product_list):

# ____________________________________
bag_list = []
non_bagged_items = []
MAX_BAG_WEIGHT = 5.0
# ____________________________________
for product in product_list:
# ____________________________________
XXXXXXXXXXif product.weight > MAX_BAG_WEIGHT:
XXXXXXXXXXproduct_list.remove(product)
XXXXXXXXXXnon_bagged_items.append(product)
# ____________________________________
cu
ent_bag_contents = []
cu
ent_bag_weight = 0.0
# ____________________________________
while len(product_list) > 0:
# ____________________________________
XXXXXXXXXXtemp_product = product_list[0]
XXXXXXXXXXproduct_list.remove(temp_product)
# ____________________________________
XXXXXXXXXXif cu
ent_bag_weight + temp_product.weight < MAX_BAG_WEIGHT:
# ____________________________________
XXXXXXXXXXcu
ent_bag_contents.append(temp_product)
XXXXXXXXXXcu
ent_bag_weight += temp_product.weight

# ____________________________________
XXXXXXXXXXif (len(product_list) == 0):
XXXXXXXXXXbag_list.append(cu
ent_bag_contents)

# ____________________________________
XXXXXXXXXXelse:
XXXXXXXXXXbag_list.append(cu
ent_bag_contents)
# ____________________________________
XXXXXXXXXXcu
ent_bag_contents = []
XXXXXXXXXXcu
ent_bag_weight = 0.0
# ____________________________________
for index, bag in enumerate(bag_list):
XXXXXXXXXXoutput = 'Bag ' + str(index + 1) + ' contains: '
# ____________________________________
XXXXXXXXXXfor product in bag:
XXXXXXXXXXoutput += product.name + '\t'
XXXXXXXXXXprint(output, '\n')
# ____________________________________
if (len(non_bagged_items) > 0):
XXXXXXXXXXoutput = 'Non-bagged items: '
# ____________________________________
XXXXXXXXXXfor item in non_bagged_items:
XXXXXXXXXXoutput += item + '\t'
XXXXXXXXXXprint(output,'\n')
Assignment 1 – FedUni Checkout
Student name:     Student ID:
    Part
    Assessment Criteria
    Weight
    Mark
    1a
    Identification of properties of a typical supermarket Product.
    10 * 0.5 = 5 marks
    
    1
    Application of abstraction to identify key properties of a typical supermarket Product as well as creation of a suitable Class Diagram.
    4 marks
    
    1c
    Identification of the key properties of a CheckoutRegister as well as creation of a suitable Class Diagram which uses those properties, plus the four method signatures provided.
    4 marks
    
    2
    Creation of an activity flowchart which clearly indicates how the program should operate, using the co
ect symbols for elements such as start/end points, processes and decisions
anches
    10 marks
    
    3
    Programming of the product checkout simulation so that it:
i) Creates a small number of Product instances that may be purchased,
ii) Accepts simulated ‘scanning’ of a Product to identify it (including refusal to identify products which do not exist),
iii) Adds a scanned Product to the CheckoutRegister’s list of products being purchased,
iv) Allows the checkout of multiple products,
v) Accepts ‘virtual money’ to pay for those products (you must pay enough to cover the cost of the items checked out), and
vi) Prints a final receipt of the products purchased, along with the total cost, total paid and any change given.
     XXXXXXXXXX5 = 30 marks.
    i)
ii)
iiI)
iv)
v)
vi)
Total:
    4a
    Analysis and documentation via code comments of the two functions provided.
    (8 * XXXXXXXXXX * 0.5) = 12 marks
    
    4
    Incorporation of the two functions provided into your main submission so that the program does not crash when an illegal money value is provided, and also virtually ‘bags up’ the products purchased.
    2
    
    
    
    
    
    
    Assignment total (out of 65 marks)
    
    
    
    Contribution to grade (out of 20 marks)
    
    
Comments:
    CRICOS Provider No. 00103D
    Insert file name here
    Page 6 of 8
    CRICOS Provider No. 00103D
    
    Page 8 of 8

ITECH1400 – Foundations of Programming
School of Science, Engineering and Information Technology
CRICOS Provider No. 00103D Page 1 of 7
ITECH1400 - Assignment 1 – Supermarket Self-Service Checkout
Due Date: 5pm, Friday of Week 7
This assignment will test your skills in designing and programming applications to specification and is worth
20% of your non-invigilated (type A) 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
each of
the university plagiarism rules. This assignment should take you approximately 20 hours to complete.
Assignment Overview
You are tasked with creating a text-based program for simulating a supermarket self-service checkout using
the Python 3 programming language.
The assignment is
oken up into four main
components:
1.) Design and model two classes: Product
and CheckoutRegister,

2.) Create an activity chart which describes
the behaviour of the checkout system,

3.) 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

4.) Explain and integrate some code into your checkout program that places the products purchased into
virtual shopping bags.
Your submission should consist of one Microsoft Word or Li
eOffice document containing the first two parts
of the assignment, and three Python scripts that implement the computer program (checkoutregister.py,
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.
You are provided with a Microsoft Word template to help you complete the first two parts of this assignment.
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.
ITECH1400 – Foundations of Programming
School of Science, Engineering and Information Technology
CRICOS Provider No. 00103D Page 2 of 7
Assignment Part 1 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 Assignment_Part_1_ 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. Take a look at the week 2 lecture slides if you need a
eminder on how to go about this.
Now, fill in the class diagram for your Product class in the Word document template provided. Your product
class does not have to have any methods (i.e. functions) associated with it to perform any actions other than a
constructor which takes and set the four key properties that you’ve identified.
Next we’ll move on to CheckoutRegister class – think about what information the checkout
Answered Same Day Apr 26, 2020 ITECH1400

Solution

Abr Writing answered on Apr 28 2020
138 Votes
School of Science, Engineering and Information Technology    
ITECH1400 – Foundations of Programming
School of Science, Engineering and Information Technology
ITECH1400 - Assignment 1 – Supermarket Self-Service Checkout
Student Name:                            Student ID:
Assignment Part 1 Details – Class Design
Insert your list/table of possible product properties here…
Product Properties (All)
    Name
    Bar code
    Available?
    Scanned?
    price
    Need more such items in store
    Predicted demand this month
    Manufacturing
and
    
    
    
    
Insert your list/table of key product properties here…
Product Properties (Key)
    Name
    Bar code
    Price
    Scanned by the custome
Complete the class diagram of your final Product class here…
Product Class Diagram
Product
None: creates a constructor containing details of all products
Price: Intege
Name: String
Barcode: Intege
CheckoutRegister Class Diagram
Complete the class diagram of your final CheckoutRegister class here…
CheckoutRegiste
Payment: Float
Product’s Barcode:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here