Foundations of Programming

IT Case Study

Questions

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)
  • 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 – SEM2/18 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 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: 1) A default constructor that takes no arguments and initialises a new object and its properties, 2) accept_payment(some_amount), 3) scan_item(some_product), and 4) print_receipt(). Fill in the class diagram for the CheckoutRegister class in the Word template, and that’s the first part completed! Assignment Part 2 Details – Activity Flowchart Using either the online website https://draw.io (preferred), or the applications Visio or Powerpoint – create an activity diagram of how the program should operate to successfully scan one or more products, accept payment, provide change and print a receipt for the user. Make sure to use the correct symbols in your diagram for starting, processes, decisions/branches, and ending the process. Although you should be familiar with how a self-checkout works, if not then you can always go to a local supermarket with a self-checkout and buy a packet of chewing gum or something – or take a look at a YouTube video of self-service checkout, such as this one: https://www.youtube.com/watch?v=hoyqVvHaL4s. Don’t worry about loyalty/rewards cards to taking payment through debit or credit cards, our CheckoutRegister will only accept cash – although you can enter multiple denominations via multiple calls to the accept_money(some_amount) method. For example, calling accept_money(5.0) and then accept_money(2.0) will mean that the CheckoutRegister knows that you have entered a total of $7.00. Also note that you can start the entire checkout process off by simply scanning a product. Once you have completed your activity flowchart, add it to your assignment template document. ITECH1400 – Foundations of Programming – SEM2/18 School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 3 of 7 Assignment Part 3 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 ‘hard-coded’ a small number of Product instances so 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 (N)ext customer is chosen, the program should run again Example Program Output ----- Welcome to FedUni checkout! ----- Please enter the barcode of your item: 123 Milk, 2 Litres - $2.0 Would you like to scan another product? (Y/N) y Please enter the barcode of your item: 456 Bread - $3.5 Would you like to scan another product? (Y/N) y Please enter the barcode of your item: 999 This product does not exist in our inventory. Would you like to scan another product? (Y/N) n Payment due: $5.5. Please enter an amount to pay: 5 Payment due: $0.5. Please enter an amount to pay: -3 We don't accept negative money! Payment due: $0.5. Please enter an amount to pay: 2 ----- Final Receipt ----- Milk, 2 Litres $2.0 Bread $3.5 Total amount due: $5.5 Amount received: $7.0 Change given: $1.5 Thank you for shopping at FedUni! (N)ext customer, or (Q)uit? q >>> ITECH1400 – Foundations of Programming – SEM2/18 School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 4 of 7 Part 4 – Code Explanation and Use You are provided with the following two functions which you should 1. Analyse to determine what they do & provide documentation comments for, and 2. Incorporate into your final program solution. Wherever there is a # followed by some underscores in the code below, you should write a short comment explaining what the below section of code is doing, and if there is space why it is doing it. Do part 1 of the above in the provided assignment 1 template document, rather than here!

Solution

Task 0

For the given case study, it is provided that Paperback Life purchases old books and re sale them to the customers. Being a smallsecond-hand book shop, Paperback Life is operated by team of three staff members: Anne, Barnardoand Carolyn.

It is provided that, Anne operates the shop from 9:00 AM to 12:30 PM on Monday, Tuesday and Wednesday;Barnardo operates from 9:00 AM to 12:30 PM, on Thursday, Friday and Saturday andCarolyn operates from12:30 PM to 5:30 PM, Monday to Friday.

Task 1

With the given data about the different staff members we created the following table that provides an overview of the work plan of the staff at the store.

Sample Content Picture

Depending on the above table the total cost for operating the business is calculated within the accompanied excel sheet which includes hourly rates, and fixed and utility costs required for the business

With the given data, following is the operational cost,

Sample Content Picture

From the above table it can be seen that the annual working hour and wages of the three staff members, insurance and utility costs are calculated which sums up to total $36480 as the annual cost for operating the business.

Task 2

Depending upon the quality of the old books and the staff members (responsible for the purchase) the book prices differed. After analysing the given excel sheet we found that the minimum offered price is $0 which means that the book was rejected and the maximum price offered was $11.5.

When the books were categorized according to the different conditions such as publication year, hard covered or paperback book by the staff members, then the books are separated in three conditions Terrible, good and poor.

Now in order to find the frequency of the books that are offered between a price range is obtained using the excel sheet. The frequency table is given below,

Sample Content Picture

From the above table it is evident that, most number of books (238) are offered with the price less than $1.2 and only 8 (5+3=8)books are offered with a price more than $10.

After plotting the distribution of the offered price by the staffs, we get the following histogram. In order to plot the histogram, we have considered the bin size 1.2.

Sample Content Picture

Online Assignment Writer Services

Assignment help

Online Assignment Help

Looking for online assignment help but tired of the poor quality help offered by other wonders? It’s time you switched to Online Assignment Help! We place extra emphasis on quality over and above everything else so you get an assignment that is easily worthy of the top grade.

Dissertation help

Dissertation Writing Help

It is a well-known fact that the most important assignment of any student’s life is the dissertation. This career-deciding assignment is also the most challenging as well as the lengthiest one, making for a rather deadly combination. Our content is free of plagiarism.

Essay Help

Essay Writing Help

Whoever has written an essay knows that it is far from an easy task. Plenty of research goes into the creation of the perfect essay, making it a rather time-consuming task even though the word count is very short. Besides, we always meet even the most pressurizing deadlines.

Thesis help Online

Academic Writing Services

Essays, dissertations and assignments are not the only areas of our expertise. We cover all academic writing services for your convenience. From research paper writing help to case study help, MBA admission essay help, thesis help, homework help and many more.