Activity flowchart of the recycling machine

Assignment Help Data Structure & Algorithms
Reference no: EM132196094

Assignment 1 - Recycling Machine

Assignment Overview

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

The assignment is broken up into four main components:
1.) Design and model two classes:RecyclableItemand RecyclingMachine,

2.) Create an activity chart which describes the behaviour of the Recycling Machine system,

3.) Create acomputer program that allows a user to enter items that are able to be recycled into a machine. During the process the machine prompts the user for the type of item to be recycled and how many they have to enter. The machine keeps track of the number of each of the different itemsand keeps track of the total amount to pay the user until they indicate that they are finished. When they stop adding items, print out a receipt and given them the amount of money owing. The receipt should contain the following:
a. A listshowing how many of each item has deposited and the cost of each item.
b. The total amount provided for each item
c. The total money received.

4.) Finally, explain and integrate some code into your Recycling Machine program that keeps track of how many items of each type are in the machine, and, if the machine is full, makes deposits of that item type unavailable. You machine should have at least 4 different products, and allow up to 50 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 (recyclingmachine.py, recyclableItem.py and main.py).

The main.py script runs the main logic of the program and will use instances of the RecyclingMachineand RecyclableItemclasses to simulate depositing into a Recycling 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 recycle that you might want to be able to deposit into aRecycling Machine, like maybe an empty soft drink can.
Start by listing all the properties of that object that you can think of - try to come up with at least tengeneral properties of aRecyclableItemand 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 Item class in the Word document template provided. Your RecyclableItemclass 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 RecyclingMachine class - think about what information the Recycling Machine has to keep track of to allow you to successfully deposit an item to be recycled. There will only really be three key properties that the RecyclingMachine cares about, and the RecyclingMachineclass 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_product(),
3) select_product()
4) payout(anAmount)
5) print_receipt().

Fill in the class diagram for the RecyclingMachine class in the Word template, and that's the first part completed!

Assignment Part 2 Details - Activity Flowchart

Using either the online website draw.io (preferred), 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 may be familiar with how a Recycling Machine works, if not then you can always look onlineRecycling Machine.
Don't worry about taking payment to debit or credit cards, our RecyclingMachine will only provide cash.
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 RecyclableIteminstances 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 recyclable items - 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.

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!

Assignment - Supermarket Self-Service Checkout template

Assignment Part 1 Details - Class Design
Insert your list/table of possible RecycleableItemproperties here...
RecycleableItem Properties (All)
RecycleableItem Properties (Key)
Complete the class diagram of your final RecycleableItem class here...
RecycleableItem Class Diagram

RecyclingMachine Class Diagram
Complete the class diagram of your final Recycling class here...

Assignment Part 2 - Activity Flowchart

Insert your activity flowchart of the recycling machine 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: ___________________________
defget_int(prompt):

# ____________________________________
value =int(0)

# ____________________________________
whileTrue:
try:
# ____________________________________
value =int(input(prompt))

# ____________________________________
if value <0:
print("We don't accept a negative number of items!")
continue

# ____________________________________
break

# ____________________________________
except ValueError:
print('Please enter a valid integer value.')

# ____________________________________
return value


# Function to: ___________________________
defaccept_item(item_list):

# ____________________________________
item_list =[]
non_accepted_items =[]
MAX_WEIGHT =15.0

# ____________________________________
foriteminitem_list:


# ____________________________________
ifitem.weight > MAX_BAG_WEIGHT:
item_list.remove(item)
non_accepted_items.append(item)

# ____________________________________
current_contents =[]
current_weight =0.0

# ____________________________________
while len(item_list)>0:

# ____________________________________
temp_item=item _list[0]
item_list.remove(temp_item)

# ____________________________________
if current_weight + temp_item.weight < MAX_WEIGHT:

# ____________________________________
current_contents.append(temp_item)
current_weight += temp_item.weight

# ____________________________________
if(len(item_list)==0):
products_item.append(current_contents)

# ____________________________________
else:
item_list.append(current_contents)

# ____________________________________
current_contents =[]
current_weight =0.0

# ____________________________________
for index, bag in enumerate(machine_list):
output ='Machine '+ str(index +1)+' contains: '

# ____________________________________
foriteminitems:
output +=item.name +'\t'
print(output,'\n')

# ____________________________________
if(len(non_accepted_items)>0):
output ='Non-bagged items: '

# ____________________________________
for item in non_accepted_items:
output += item +'\t'
print(output,'\n')

Attachment:- recycling machine.rar

Reference no: EM132196094

Questions Cloud

Stories about the accuracy of wikipedia : What is the lesson learned from the stories about the accuracy of Wikipedia?
Create a measurement plan to assess the phenomenon : Provide at least 3 questions you would use to measure this phenomenon and explain how these questions operationalize the phenomenon.
Post an explanation of the types of descriptive statistics : Post an explanation of the types of descriptive and/or inferential statistics you might use to analyze the data gathered in the case study.
What are some things you can do more efficiently : What are some things you can do more efficiently? What are the main items/tasks that take up most of your time?
Activity flowchart of the recycling machine : Activity flowchart of the recycling machine process here - comments describing what the code is doing - for each line starting with a hash symbol you should
What are father arrupe main point : What are Father Arrupe's main point? What does he mean when he says: "Take justice away from love and you destroy love. You do not have love if the beloved.
Write a one paragraph overview of the issue : Write a one paragraph overview of the issue. Be sure to include the title and author of the article you are reviewing.
Discuss about the roles of women in given world war : One of the most iconic images of World War II is the famous "We Can Do It!" and the creation of Rosie the Riveter. Images like this represented an important.
Analyze the change from romanesque to gothic architecture : Analyze the change from Romanesque to Gothic Architecture. Discuss how one style developed into the other, what influenced the Romanesque style.

Reviews

len2196094

12/17/2018 3:35:39 AM

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 itemis provided provided, and also virtually ‘bags up’ the items to be recycled. +1 mark for actually using them. 3 Deductions • Poor quality • Not fully implemented • Incomplete submissions • Insufficient comments • Poor variable/function names Assignment total (out of 65 marks) Contribution to grade (out of 20 marks)

len2196094

12/17/2018 3:35:31 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 10 marks 3 Programming of the product Recycling Machine simulation so that it: i) Creates a small number of items to be recycled instances that may be added to the machine, ii) Accepts selection of an item to recycle to identify it (including refusal to identify products which do not exist), iii) Adds a selectedrecycleable item to the RecyclingMachine list of items collected, iv) Allows the recycling of multiple products, v) Prints a final receipt of the products purchased, along with the total cost, total paid and any change given. vi) Indicates when the machine is full of items 5 + 5 + 5 + 5 + 5 + 5 = 30 marks. i) ii) iiI) iv) v) vi) Total:

len2196094

12/17/2018 3:35:21 AM

Submit your assignment (all program source files plus your word processed document) Moodle. 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. Assignment 1 – FedUniRecycling Machine Student name: Student ID: Part Assessment Criteria Weight Mark 1a Identification of properties of a typical Recycling Machinerecycleable item. 10 * 0.5 = 5 marks 1b Application of abstraction to identify key properties of a typical Recycling Machinerecycleable item as well as creation of a suitable Class Diagram. 4 marks 1c Identification of the key properties of a RecyclingMachine as well as creation of a suitable Class Diagram which uses those properties, plus the five method signatures provided. 4 marks

len2196094

12/17/2018 3:35:09 AM

You must supply your program source code files and your document containing the first two section of the assignment as a single compressed archive called 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.

len2196094

12/17/2018 3:34:51 AM

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.

Write a Review

Data Structure & Algorithms Questions & Answers

  The binary search algorithm

- The "origin" of the Cartsian plane in math is the point where x and y are both zero. Declare a variable of type POINT named origin and set its data dields consistent with the mathematical notion of "origin".

  Evaluate the performance of Fibonacci Search algorithm

In this task, you are to write a MATLAB function and accompanying test harness to evaluate the performance of Fibonacci Search algorithms

  Develop the flow diagram of the information

Develop the flow diagram of the information and any control elements needed to ensure proper access for the information. A diagram of the information flow and any elements controlling proper access to the information it uses

  Write non-recursive inorder traversal for binary search tree

Evaluate functions to handle boolean statements. Using the find_successor method, write a non-recursive inorder traversal for a binary search tree.

  Features of a database view

Does a view occupy space in the database? In other words, does a view contain any data

  Binary search tree in ascending order by standard deviation

In this exercise you will create ten records, each containing the following fields: student name, class: Freshman, Sophomore, Junior or Senior, Major: Liberal Arts or General Science and ten randomly generated test scores between 0 and 100 for each s..

  Compute the total number of comparisons used to sort

Your task is to compute the total number of comparisons used to sort the given input file by Quicksort. For this part you should always use the first element of the array as the pivot element.

  Plot the time complexity according to theoretical bounds.

Be sure to only include the time needed for sorted, excluding the time to generate the random numbers. Plot the results (input size, running time) for BubbleSort and MergeSort.

  Analyzing network problem

Assume you are the Systems Analyst at a producing corporation in Seattle, WA. A Systems Analyst in your company's New York office sends you a trace file to examine.

  Write the code to implement the method

The "linked list" has a integer "position". In an array, the position is very easy to implement as it is related to the "index" of the array. In the "linked list", the position is much more difficult.

  Write a bubble sort function with a test program

Write a comparative algorithm that will compare the efficiency of three sorting routines. Write a Bubble Sort function with a test program.

  Oracle provides erp solutions for mid-size business

oracle provides erp solutions for mid-size business organizations. for this assignment you are to write a research

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