Question: Use Processing with Python Code: This code is in python, use it processing: Python sketch_210223a 18 19 numen: return numBn else: return numer det main():

Use Processing with Python Code:
Use Processing with Python Code: This code is in python, use it
processing: Python sketch_210223a 18 19 numen: return numBn else: return numer det
main(): Main function print("Pressing "'g' key Increases/Decreases the number of frank packages)
This code is in python, use it processing: print("Pressing by'n' key Increases Decreases the number of bun packages") print("Pressing any
other key to stop processing...) frankPack = 0 bunPack 0 # Iterate
till user want to quit while True # Reading user input ch=input()
# Processing input if ch.lower()== frankPack 1 elif ch.lower) if frankPack >

Python sketch_210223a 18 19 numen: return numBn else: return numer det main(): Main function print("Pressing "'g' key Increases/Decreases the number of frank packages) print("Pressing by'n' key Increases Decreases the number of bun packages") print("Pressing any other key to stop processing...) frankPack = 0 bunPack 0 # Iterate till user want to quit while True # Reading user input ch=input() # Processing input if ch.lower()== frankPack 1 elif ch.lower) if frankPack > 0 frankPack-1 else: print("No Frankies Available...") elif chlower) bunPack+=1 elif ch.lower()=="n": If bunPack > 0 bunPack-1 olse: print("No Buns Available..) else break Testing maximum number of hot dogs can be made # Converting Packages into units numFr = frankPack * 12 numBn = bunPack 8 # Printing results print(" Il you have " + str(frankPack) + packages of franks +strinumFt) + franks total) and . 2 marks for function make_hotdogs(): 1 mark for interface displaying relevant information (count of packages, and total hotdogs). 1 mark for correctly capturing input that modifies the number of packages of franks and buns. 2 marks for submitting testing 1 mark for documenting code using comments and docstrings. 1 mark for using good Model-View-Controller design. def make_hotdogs (frPack, bnPack): numFr = frPack * 12 numBn = bnPack * 8 if numFr > numBn: return numBn else: return numFr def setup(): print("Pressing 'fl'g' key Increases/Decreases the number of frank packages") print("Pressing 'b'/'n' key Increases/Decreases the number of bun packages") print("Pressing any other key to stop processing...") frankPack = 0 bunPack = 0 while True: if keyPressed=="f": frankPack+=1 elif keyPressed=="g": if frankPack > o: frankPack-=1 else: print("No Frankies Available...") elif keyPressed=="b": bunPack+=1 elif keyPressed=="n": if bunPack > O: bunPack-=1 else: print("No Buns Available...) else: break numFr = frankPack * 12 numBn = bunPack * 8 Python sketch_210223a 18 19 numen: return numBn else: return numer det main(): Main function print("Pressing "'g' key Increases/Decreases the number of frank packages) print("Pressing by'n' key Increases Decreases the number of bun packages") print("Pressing any other key to stop processing...) frankPack = 0 bunPack 0 # Iterate till user want to quit while True # Reading user input ch=input() # Processing input if ch.lower()== frankPack 1 elif ch.lower) if frankPack > 0 frankPack-1 else: print("No Frankies Available...") elif chlower) bunPack+=1 elif ch.lower()=="n": If bunPack > 0 bunPack-1 olse: print("No Buns Available..) else break Testing maximum number of hot dogs can be made # Converting Packages into units numFr = frankPack * 12 numBn = bunPack 8 # Printing results print(" Il you have " + str(frankPack) + packages of franks +strinumFt) + franks total) and . 2 marks for function make_hotdogs(): 1 mark for interface displaying relevant information (count of packages, and total hotdogs). 1 mark for correctly capturing input that modifies the number of packages of franks and buns. 2 marks for submitting testing 1 mark for documenting code using comments and docstrings. 1 mark for using good Model-View-Controller design. def make_hotdogs (frPack, bnPack): numFr = frPack * 12 numBn = bnPack * 8 if numFr > numBn: return numBn else: return numFr def setup(): print("Pressing 'fl'g' key Increases/Decreases the number of frank packages") print("Pressing 'b'/'n' key Increases/Decreases the number of bun packages") print("Pressing any other key to stop processing...") frankPack = 0 bunPack = 0 while True: if keyPressed=="f": frankPack+=1 elif keyPressed=="g": if frankPack > o: frankPack-=1 else: print("No Frankies Available...") elif keyPressed=="b": bunPack+=1 elif keyPressed=="n": if bunPack > O: bunPack-=1 else: print("No Buns Available...) else: break numFr = frankPack * 12 numBn = bunPack * 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!