SODA_COST = 0.5 HOTDOG_COST = 0.75 def hotdogs(tim, amy): """ Returns the number of hotdogs required for the party. Parameters: tim -- the number of hotdogs tim will eat amy -- the number of hotdogs amy will eat """ todd = 2 * amy brenda = todd - 1 mark = (brenda+1)/2 + 1 # add 1 to brenda to round up total_hotdogs = tim + amy + todd + brenda + mark return total_hotdogs def soda(num_people): """ Returns the number of sodas required for num_people """ return 2 * num_people def bbq_cost(tim, amy, num_people): """ Calculates the total cost of the BBQ """ num_hotdogs = hotdogs(tim, amy) num_sodas = soda(num_people) return num_sodas * SODA_COST + num_hotdogs * HOTDOG_COST def bbq_plan(tim, amy, num_people): """ Prints out the plan for the BBQ """ print "We need to buy " + str(hotdogs(tim, amy)) + " hotdogs" print " and " + str(soda(num_people)) + " sodas for a total" print " cost of $" + str(bbq_cost(tim, amy, num_people))