Describes the behaviour of the vending machine system

Assignment Help Python Programming
Reference no: EM132117457

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:- Assignment__Vending_Machine.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: EM132117457

Questions Cloud

Successful product and service innovations : Describe the horizontal linkage model and how it contributes to successful product and service innovations.
What does the extends keyword do : Which keyword is used to place GUI components such as labels and buttons into a frame? What does the extends keyword do?
How does interrelationship support or guide your ebp project : Fawcett and Garity (2009) present an overview of the relationship between theory, knowledge, research, nursing research, and evidence-based practice.
Explain disruptive innovation : Discuss organizational change and explain disruptive innovation and the ambidextrous approach as possible responses to the forces that drive innovation
Describes the behaviour of the vending machine system : Design and model two classes:Productand VendingMachine - Create an activity chart which describes the behaviour of the vending machine system
Write a java console program that read a text string : Create a static method fillArray() that would accept array of 1000 int as the only parameter and would initialize them randomly.
Newly emerging multinational corporation : Jane's panes inc. Is a newly emerging multinational corporation that designs, manufactures, markets and sells decorative antique-look window pane art decoration
Describe your experience in assessing the patient : Reflect on a patient who presented with a behavioral or mental health issue during your Practicum experience. Describe your experience in assessing.
Build nfas for the following two languages : For NFA or o-NFA questions, try to take advantage of non-determinism in the interest of keeping the design simple and elegant.

Reviews

urv2117457

10/27/2018 2:25:21 AM

Highly recommend they went out of their way to get this assignment done. I have used their service once before and again, I am fully satisfied by their outstanding work. WOW... Great. I can't believe that I can get the solution in just 8hrs. It is really surprising for me. thanks a lot, guys for such instant work and the solution is also very good. Thanks once more for the discount.

urv2117457

10/27/2018 2:23:08 AM

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. 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 selected Product 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.4a Analysis and documentation via code comments of the functions provided. 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.

urv2117457

10/27/2018 2:21:39 AM

Assessment Criteria:1a Identification of properties of a typical vending machine Product.1b Application of abstraction to identify key properties of a typical vending machine Product as well as creation of a suitable Class Diagram.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.

urv2117457

10/27/2018 2:20:26 AM

replace <YOUR-NAME> and <YOUR-STUDENT-ID) with your own personal details! You may supply your word processed documentation in either Microsoft Word or LibreOffice/OpenOffice formats only – no proprietary Mac specific formats, please. 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.

urv2117457

10/27/2018 2:19:35 AM

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, Submission and Marking ProcessYou must supply your program source code files and your document containing the first two section of the assignment as a single compressed archive called: ITECH1400_Assignment_1_<YOUR-NAME>_<YOUR-STUDENT-ID>.zip

Write a Review

Python Programming Questions & Answers

  Python script that reads and analyses child mortality data

ICT702 - Data Wrangling - Write a Python script that reads and analyses the child mortality data - Use Python to combine the child mortality data

  Write a program to simulate the grocery store

You have been asked to write a program to simulate the grocery store as it checks out customers. YOU ARE REQURED TO USE A QUEUE TO SOLVE THE PROBLEM.

  Track the current position and direction of the ball

If the player chooses to play against an automated paddle, your program should control the motion of the paddle. You can track the current position and direction of the ball to estimate whether it should move up or down from its current position.

  Write a program that asks the user for a letter

Write a program that asks the user for a letter. The program should then determine if the letter is a vowel or not

  1 one factor that leads to a decline in biodiversity is the

1. one factor that leads to a decline in biodiversity is the introduction of non-native species. however most species

  Need an expert to guide in finishing the programs

I have built code for a soduko board. The progression has been done over 3 .py files. I'm having difficulty finishing several aspects, and need an expert to guide in finishing the programs.

  Design a solution to highly-repetitive computational problem

IFB104 Building IT Systems Assignment Part A: Cityscapes. Design a solution to a highly-repetitive computational problem; Produce maintainable, reusable code

  Write python code that will execute a list

Write python code that will execute a list of functions with supplied parameters and report the observed runtime for each function run. Assume that the input file has a list of strings like so:

  Write a function that will take two arguments

Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid and write code to read, in turn, each line of the file, remove the newline character and append the resulting string to a list of stri..

  Create a python program for managing media check-out

Create a python program for managing media check-out/check-in with members - Store a list of checked out items for a member and create a method to display it

  Develop program that randomly generate shakespearean insults

Assignment: Shakespearean Insults- Develop a program that will randomly generate twenty Shakespearean insults using the lists of words in the table below.

  Write Python program that generates an informative web site

ICT112 Assignment - Generated Web Site for Aussie Airport Passenger Movements. University of the Sunshine Coast. write a Python program that generates a site

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