School of Science, Engineering and Information Technology ITECH1400 – Foundations of Programming School of Science, Engineering and Information Technology ITECH1400 - Assignment 1 – Container...

1 answer below »
Please check the attachment.


School of Science, Engineering and Information Technology ITECH1400 – Foundations of Programming School of Science, Engineering and Information Technology ITECH1400 - Assignment 1 – Container Recycling Machine Student Name:Student ID: Assignment Part 1 Details – Class Design Insert your list/table of possible Container properties here… Container Properties (All) Insert your list/table of key product properties here… Container Properties (Key) Complete the class diagram of your final Container class here… Container Class Diagram Container_Recycling_Machine 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: ___________________________ def get_int(prompt): # ____________________________________ value = int(0) # ____________________________________ while True: 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:="" ___________________________="" def="" accept_item(item_list):="" #="" ____________________________________="" item_list="[]" non_accepted_items="[]" max_weight="15.0" #="" ____________________________________="" for="" item="" in="" item_list:="" #="" ____________________________________="" if="" item.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:="" '="" #="" ____________________________________="" for="" item="" in="" items:="" 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') Assignment 1 – FedUni Checkout Student name: Student ID: Part Assessment Criteria Weight Mark 1a Identification of properties of a typical item that can be recycled – Container. 10 * 0.5 = 5 marks 1b Application of abstraction to identify key properties of a typical Container as well as creation of a suitable Class Diagram. 4 marks 1c Identification of the key properties of a Container_Recycling_Machine 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 Container Recycling Machine simulation so that it: i) Creates a small number of Container instances that may be accepted, ii) Accepts simulated ‘deposting’ of a Container after being identified from a list by the user, iii) Adds a Container to the Container_Recycling_Machine list of containers being purchased, iv) Allows the deposit of multiple containers, v) Provides ‘virtual money’ to pay for those containers and vi) Prints a final receipt with the number of each container type and the amount for these containers, along with the total number of containers and the total amount paid out. (See example in the assessments instructions.) 4 + 4 + 4 + 4 + 4 + 4 = 24 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 Overall Overall code standard including comments, formatting, variable names 9 Assignment total (out of 70 marks) Contribution to grade (out of 20 marks) Comments: CRICOS Provider No. 00103D Insert file name here Page 6 of 8 CRICOS Provider No. 00103D Page 1 of 5
Answered Same DayDec 30, 2021ITECH1400

Answer To: School of Science, Engineering and Information Technology ITECH1400 – Foundations of Programming...

Neha answered on Jan 04 2021
156 Votes
74171 - recycle python/~WRD0005.tmp
School of Science, Engineering and Information Technology    
ITECH1400 – Foundations of Programming
School of Science, Engineering and Information Technology
ITECH1400 - Assignment 1 – Container Recycling Machine
Student Name:                            Student ID:
Assignment Part 1 Details – Class Design
Soft Drink Can
Container Properties (All)
        Appearance
        Texture
        Colour
        Odour
        Melting point
        Boiling point
        Density
        Solubility
        Polarity
        Weight
        Dimension
        Radius
Insert your list/table of key product properties
here…
Container Properties (Key)
        Radius
        Weight
        Colour
        Dimension
Complete the class diagram of your final Container class here…
Container Class Diagram
Container
Int Radius
Int weight
Char colour
Int dimension
Container(radius,weight,colour,dimension)
Container_Recycling_Machine Class Diagram
Complete the class diagram of your final Recycling class here…
Container_Recycling_Machine
Radius
Weight
colour
Recycling_machine(self)
accept_product(),
select_product()
payout(anAmount)
print_receipt()
Assignment Part 2 – Activity Flowchart
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: ___________________________
def get_int(prompt):
# ____________________________________
value = int(0)
# ____________________________________
while True:
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: ___________________________
def accept_item(item_list):

# ____________________________________
item_list = []
non_accepted_items = []
MAX_WEIGHT = 15.0
# ____________________________________
for item in item_list:
# ____________________________________
if item.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: '
# ____________________________________
for item in items:
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')
Assignment 1 – FedUni Checkout
Student name:     Student ID:
        Part
        Assessment Criteria
        Weight
        Mark
        1a
        Identification of properties of a typical item that can be recycled – Container.
        10 * 0.5 = 5 marks
        
        1b
        Application of abstraction to identify key properties of a typical Container as well as creation of a suitable Class Diagram.
        4 marks
        
        1c
        Identification of the key properties of a Container_Recycling_Machine 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 Container Recycling Machine simulation so that it:
i) Creates a small number of Container instances that may be accepted,
ii) Accepts simulated ‘deposting’ of a Container after being identified from a list by the user,
iii) Adds a Container to the Container_Recycling_Machine list of containers being purchased,
iv) Allows the deposit of multiple containers,
v) Provides ‘virtual money’ to pay for those containers and
vi) Prints a final receipt with
the number of each container type and the amount for these containers, along with the total number of...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here