Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago