FedUni Checkout – Assignment

Assignment Part 1 Details – Class Design

Assignment Part 1 Details – Class Design

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Insert your list/table of possible product properties here…

Product Properties (All)

prodName

prodCode

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

sellPrice

prodCategory

stockQty

manufacturerID

manufacturerCompany

purchaseCost

dateAdded

dateModify

 Insert your list/table of key product properties here…

Product Properties (Key)

prodCode

prodName

sellPrice

prodCategory

 Complete the class diagram of your final Product class here…

Product Class DiagramCheckoutRegister Class Diagram

Complete the class diagram of your final CheckoutRegister class here…Assignment Part 2 – Activity FlowchartAssignment Part 3 – Software Implementation

The .py files are attached  (3 .py files)

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: Input a number and convert to float type

def get_float(prompt): 

    # initialize value to 0.0

    value = float(0.0) 

    # loop and check  if value > 0.0 or check validity of floating value using exception

    while True:

        try:

            # input from keyboard and convert to float type and store it in value

            value = float(input(prompt)) 

            # check if value is negative

            if value < 0.0:

                print(“We don’t accept negative money!”)

                continue 

            # if value is negative, print the error message and exit the loop

            break 

        # catch the exception

        except ValueError:

            print(‘Please enter a valid floating point value.’) 

    # return value when valid floating number is inputted and value is > 0.0

    return value 

# Function to: Add the product to shopping cart bag

def bag_products(product_list):   
    # create list of shopping bag and products which are not stored in shopping bag

    bag_list = []

    non_bagged_items = []

    MAX_BAG_WEIGHT = 5.0 

    # loop through the product list

    for product in product_list: 

        # if weight is > MAX_BAG_WEIGHT.

        # then remove product from the product list and add product

        # to non-bagged list

        if product.weight > MAX_BAG_WEIGHT:

            product_list.remove(product)

            non_bagged_items.append(product) 

    # create list of current shopping bag and set the current bag weight = 0.0

    current_bag_contents = []

    current_bag_weight = 0.0 

    # loop till the length of the product_list > 0

    while len(product_list) > 0: 

        # store product at index 0 to temp_product variable and

        # remove the product stored in temp_product variable from the product list

        temp_product = product_list[0]

        product_list.remove(temp_product) 

        # check if current bag weight + weight of the temp_product < MAX_BAG_WEIGHT 

        if current_bag_weight + temp_product.weight < MAX_BAG_WEIGHT: 

            # add temp_product to current bag and add the weight of temp_product weight      

            # to the current bag weight

            current_bag_contents.append(temp_product)

            current_bag_weight += temp_product.weight          

            # check if length of the product list = 0 and store the current bag list

            # to the bag list

            if (len(product_list) == 0):

                bag_list.append(current_bag_contents)               

        # check if current bag weight + temp_product weight > MAX_BAG_WEIGHT

        # then store current bag list to the bag list

        else:

            bag_list.append(current_bag_contents) 

            # reset the current bag list to null and current bag weight = 0.0

            current_bag_contents = []

            current_bag_weight = 0.0 

    # loop through the bag list to print the products stored in the shopping bag

    for index, bag in enumerate(bag_list):

        output = ‘Bag ‘ + str(index + 1) + ‘ contains: ‘ 

        # print product name stored in the bag

        for product in bag:

            output += product.name + ‘t’

        print(output, ‘n’) 

    # check if length of the non bagged items > 0 then print the non bagged products

    if (len(non_bagged_items) > 0):

        output = ‘Non-bagged items: ‘

        # loop through to print non bagged products name

        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)

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Course Scholars
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Technology
Thank you for your work
Customer 452551, October 22nd, 2021
Accounting
Thank you for your help. I made a few minor adjustments to the paper but overall it was good.
Customer 452591, November 11th, 2021
Education
Thank you so much, Reaserch writer. you are so helpfull. I appreciate all the hard works. See you.
Customer 452701, February 12th, 2023
Psychology
Thank you. I will forward critique once I receive it.
Customer 452467, July 25th, 2020
Business Studies
Great paper thanks!
Customer 452543, January 23rd, 2023
Political science
Thank you!
Customer 452701, February 12th, 2023
Psychology
I requested a revision and it was returned in less than 24 hours. Great job!
Customer 452467, November 15th, 2020
Finance
Thank you very much!! I should definitely pass my class now. I appreciate you!!
Customer 452591, June 18th, 2022
Political science
I like the way it is organized, summarizes the main point, and compare the two articles. Thank you!
Customer 452701, February 12th, 2023
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat

Order your essay today and save 15% with the discount code GINGER