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 »
use templete


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: try: # ____________________________________ value = float(input(prompt)) # ____________________________________ if value < 0.0:="" print("we="" don't="" accept="" negative="" money!")="" continue="" #="" ____________________________________="" break="" #="" ____________________________________="" except="" valueerror:="" print('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:="" #="" ____________________________________="" if="" product.weight=""> MAX_BAG_WEIGHT: product_list.remove(product) non_bagged_items.append(product) # ____________________________________ current_bag_contents = [] current_bag_weight = 0.0 # ____________________________________ while len(product_list) > 0: # ____________________________________ temp_product = product_list[0] product_list.remove(temp_product) # ____________________________________ if current_bag_weight + temp_product.weight < max_bag_weight:="" #="" ____________________________________="" current_bag_contents.append(temp_product)="" current_bag_weight="" +="temp_product.weight" #="" ____________________________________="" if="" (len(product_list)="=" 0):="" bag_list.append(current_bag_contents)="" #="" ____________________________________="" else:="" bag_list.append(current_bag_contents)="" #="" ____________________________________="" current_bag_contents="[]" current_bag_weight="0.0" #="" ____________________________________="" for="" index,="" bag="" in="" enumerate(bag_list):="" output='Bag ' +="" str(index="" +="" 1)="" +="" '="" contains:="" '="" #="" ____________________________________="" for="" product="" in="" bag:="" output="" +="product.name" +="" '\t'="" print(output,="" '\n')="" #="" ____________________________________="" if="" (len(non_bagged_items)=""> 0): output = 'Non-bagged items: ' # ____________________________________ for item in non_bagged_items: output += item + '\t' print(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 1b 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 correct symbols for elements such as start/end points, processes and decisions/branches 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. 5 + 5 + 5 + 5 + 5 + 5 = 30 marks. i) ii) iiI) iv) v) vi) Total: 4a Analysis and documentation via code comments of the two functions provided. (8 * 0.5) + (16 * 0.5) = 12 marks 4b 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 breach 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 broken 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 LibreOffice 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 reminder 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 DayApr 26, 2020ITECH1400

Answer To: School of Science, Engineering and Information Technology ITECH1400 – Foundations of Programming...

Abr Writing answered on Apr 28 2020
147 Votes
School of Science, Engineering and Information Technology    
ITECH1400 – Foundations of Programming
Sc
hool 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 brand
    
    
    
    
Insert your list/table of key product properties here…
Product Properties (Key)
    Name
    Bar code
    Price
    Scanned by the customer
Complete the class diagram of your final Product class here…
Product Class Diagram
Product
None: creates a constructor containing details of all products
Price: Integer
Name: String
Barcode: Integer
CheckoutRegister Class Diagram
Complete the class diagram of your final CheckoutRegister class here…
CheckoutRegister
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