You will write three functions for managing a hazard: the seconds of warning of an early warning system, the hours that an evacuation needs, and the benefit-cost ratio of a measure.
The idea. The S waves travel at , so a town at distance gets seconds of warning, and none if this is negative. An evacuation needs people divided by the rate. The ratio is (chance loss avoided) divided by (cost divided by years).
Your tasks.
warning_seconds, return the seconds of warning for a town d km from the focus when the alert comes alert seconds after the start. Return 0 if there is no warning.evacuation_hours, return the hours needed to move people people at rate people each hour.benefit_cost, return the benefit-cost ratio for a chance, a loss avoided, a total cost and years of use.Run your code once to unlock the worked solution.
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…