You will write a program as three small functions, as a structure diagram would split it. Each function is one box.
Your tasks.
work_out_cost, return the cost of the tickets: dollars for each adult and dollars for each child.apply_discount, take dollars off the total when the group has or more people. Otherwise return the total as it is.final_cost, use the two functions above to return what the group pays.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…