Question
Please Create a flow chart for the following program: # Lab 5-4 the Bottles Return Program # the main function def main(): endProgram = 'no'
Please Create a flow chart for the following program:
# Lab 5-4 the Bottles Return Program # the main function
def main(): endProgram = 'no' whileendProgram == 'no' : totalBottles = getBottles() totalPayout = calcPayout(totalBottles) printInfo(totalBottles, totalPayout) endProgram = input('Do you want to end the program? (Enter yes or no): ')
# this function will get the number of bottles returned
defgetBottles():
totalBottles = 0 todayBottles = 0 counter = 1
while counter <= 7: todayBottles = int(input('Enter number of bottles for today: ')) totalBottles = totalBottles + todayBottles counter = counter + 1 returntotalBottles
# this function will calculate the payout
defcalcPayout(totalBottles): totalPayout = 0 totalPayout = totalBottles * .10 returntotalPayout
# this function will display the information
defprintInfo(totalBottles, totalPayout): print('The total number of bottles collected is' ,totalBottles) print('The total paid out is $ ' ,totalPayout)
# call main main()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started