Describes the behaviour of the vending machine system

Assignment Help Python Programming
Reference no: EM132100849

Assignment Overview

You are tasked with creating a text-based program for simulating a Vending Machineusing the Python 3 programming language.

The assignment is broken up into four main components:

1.) Design and model two classes:Productand VendingMachine,

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

3.) Create acomputer program that allows a user to enter an amount of money, then interactively purchasea number of products until they either stop or the balance is zero. When they stop, print out a receipt. The receipt should contain the following:
a. A listshowing each item bought and the cost of each item.
b. The total money received.
c. The total spent.
d. Their change, if their balance was not completely spent.

4.) Finally, explain and integrate some code into your vending machine program that keeps track of how many products are available in the machine, and if an item is sold out, make it unavailable to the user. You machine should have at least 3 different products, and 2 of each product.

Your submission should consist of one document containing the first two parts of the assignment, and three Python scripts that implement the computer program (vendingmaching.py, product.py and main.py).
The main.py script runs the main logic of the program and will use instances of the VendingMachineand Product classes to simulate purchasing from a vending machine.

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.


Assignment Part 1 Details - Class Design

Think of a product that you can buy from a vending machine, like maybe a can of soft drink or a bag of chips.
Start by listing all the properties of that object that you can think of - try to come up with at least tengeneral properties of a Product and write these down in your Assignment_Part_1_<YOUR_STUDENT_ID>Microsoft Word document, provided for download in the assessment section of your Moodle shell.

Next, use the process of abstraction to cut the number of properties back to only ‘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 key properties that you've identified.

Next we'll move on to VendingMachine class - think about what information the vending machine has to keep track of to allow you to successfully purchase a product. There will only really be three key properties that the VendingMachine cares about, and the VendingMachineclass should have the following five methods available:
1) A default constructor that takes no arguments and initialises a new object and its properties,
2) accept_money(),
3) select_product()
4) buy_product(some_product)
5) print_receipt().
Fill in the class diagram for the VendingMachine class in the Word template, and that's the first part completed!

Assignment Part 2 Details - Activity Flowchart

Using either the online website, or the applications Visio or Powerpoint - create an activity diagram of how the program should operate to successfully enter their money, buy one or more products, 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 vending machine works, if not then you can always go to a local vending machine (there are plenty on campus) buy your course coordinator a can of Coke-Cola (No Sugar please). - or take a look at a YouTube video of vending machine.

Don't worry about taking payment through debit or credit cards, our VendingMachine will only accept cash - although you can enter multiple denominations via a loop in theaccept_money(some_amount) method. For example, calling accept_money() will keep prompting the user to enter more money until they hit enter without giving a number.The customer must enter all their money before buying a product, they can't add to their balance once they have begun buying products.

Once you have completed your activity chart, add it to your assignment template document.

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 which exist can be purchased - 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 STOP is chosen, the program should print the receipt and ask the user if they want to start again or quit.

Attachment:- Template.rar

Verified Expert

The project is in python 3 programming. It illustrate the use of object oriented programming in Python 3. In the assignment we have a product class which is used to create the object with product code, product name, price and quantity as its member. The VendingMachine class uses the product class by importing it. When program is executed the user first enter the money in the system. After that the program displays the name of the product name which user can buy. The user enter the product name to buy and the product name is displayed along with the balance amount.If product name is available, the same is added to a shopping list, else gives the error message if the product is not available. When user quits entering the products it displays the receipt along with total amount deposited, total amount spent and the change amount returned if any.

Reference no: EM132100849

Questions Cloud

What would the procedure be called : What should Mary do to protect her jurisdictional rights in Colorado? What would the procedure be called?
Find the maximum velocity of the car : Find the maximum velocity vmax of the car during the ten-second interval depicted in the graph. Express your answer in meters per second to the nearest integer.
Would the project take longer-would anything else change : Would the project take longer? Would anything else change?
Fields cookies company faces : Describe three organizational problems that the Mrs. Fields’ Cookies Company faces.
Describes the behaviour of the vending machine system : Assignment – Vending Machine - Foundations of Programming - creating a text-based program for simulating a Vending Machineusing the Python programming language
True about reliability : Which of the following is NOT true about reliability? Measures are unreliable.
Complaints of quality and efficiency of delivery of product : XYZ is a domestic manufacturing plant that has declining profits and has consistent complaints of quality and efficiency of delivery of product.
Determine the mean variance and standard deviation : Research Methods - Data Treatment for Biologists - Determine the mean, variance, standard deviation and 95% confidence interval for each data set
What is the linear speed of the blade tip : Our balance is maintained, at least in part, by the endolymph fluid in the inner ear. Spinning displaces this fluid, causing dizziness. Suppose a dancer.

Reviews

inf2100849

12/16/2018 11:56:14 PM

When program is executed the user first enter the money in the system. After that the program displays the name of the product name which user can buy. Its an excellent service.. It is always meeting my exception and I am sure that I will be using Experts Mind services in future. I will tell to my classmates and friends.

len2100849

8/31/2018 2:00:31 AM

3 Programming of the product vending machine simulation so that it: i) Creates a small number of Product instances that may be purchased, ii) Accepts ‘virtual money’ to pay for products (you must pay enough to cover the cost of the items you will be buying) iii) Accepts selection of a Product to identify it (including refusal to identify products which do not exist), iv) Adds a selectedProduct to the VendingMachine list of products purchased, v) Allows the purchase of multiple products, 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 functions provided. (8 * 0.5) + (14 * 0.5) = 11 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. +1 mark for actually using them. 3 Deductions • Poor quality • Not fully implemented • Incomplete submissions • Insufficient comments • Poor variable/function names

len2100849

8/31/2018 2:00:20 AM

Part Assessment Criteria Weight Mark 1a Identification of properties of a typical vending machineProduct. 10 * 0.5 = 5 marks 1b Application of abstraction to identify key properties of a typical vending machineProduct as well as creation of a suitable Class Diagram. 4 marks 1c Identification of the key properties of a VendingMachine as well as creation of a suitable Class Diagram which uses those properties, plus the five 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

len2100849

8/31/2018 1:58:02 AM

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 requirements, including (but not limited to): • Incomplete implementation(s), and • Incomplete submissions (e.g. missing files), and • Poor spelling and grammar. Submit your assignment (all program source files plus your word processed document) to the Assignment 1 Upload location on Moodle before the deadline of Friday of week 7 at 5pm. The mark distribution for this assignment is explained on the next page – please look at it carefully and compare your submission to the marking guide.

Write a Review

Python Programming Questions & Answers

  Write python program isosceles tri equilateral tri rectangle

Write python program Isosceles Tri Equilateral Tri Rectangle, Write another "driver" script called project1.py which imports the polygon.py module, reads an input file of polygonal data and writes another file of areas and perimeters.

  Without using the system function to call any bash commands

without using the system function to call any bash commands write a python program that will implement a simple version

  Program for simulating a supermarket self-service checkout

ITECH1400 - Foundations of Programming - Design and model two classes: Product and CheckoutRegister and Create an activity chart which describes the behaviour

  Write a python program that generates a small web site

ICT112 Assignment. Your task in this assignment is to write a Python program that generates a small web site to inform Sunshine Coast people about some aspect of the local environment or a local sustainability issue

  Write a python program that saves du in the text file

Write a Python program that saves "DU" in the file txt file. Write a Python program that will allow the user to enter following information for three students.

  What are the issues assciated with top-down analysis

what are the issues assciated with top-down analysis please explain?

  Application that will allow user to maintain collections

Build a menu-driven application that will allow a user to maintain their collections. For example, I might have a coin collection, or a record collection, or a collection of all my valuable items.

  Planning the tropical airlines program

CP1401 - Fundamentals of Problem Solving and Programming - Jamescook University - Use what you have learned in class, including simple functions, selection

  Integration of mnch commodities supply chain management

Objective of the study is to examine the outcome of integration of logistic and supply chain management of MNCH commodities on service delivery, specific objectives have been set to achieve the aim of the study.

  Write a non-fruitful function drawequitriangle

Write a non-fruitful function drawEquitriangle(someturtle, somesize) which calls drawPoly from the previous question to have its turtle draw a equilateral triangle

  Define a function findword that takes a line as input

Define a function "findWord" that takes a line as input and return the words & their counts (if stopwords, don't count the word)

  Write programs that read a sequence of integer inputs

Write programs that read a sequence of integer inputs and print The smallest and largest of the inputs. The number of even and odd inputs.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd