You will write three functions for floods and droughts: the discharge of a river, the peak flow by the rational method, and the class of a drought.
The idea. The discharge is width times depth times speed. The peak flow is . The rainfall deficit is . A deficit of or less is no drought, up to is moderate and above is severe.
Your tasks.
discharge, return the discharge in of a river width m wide and depth m deep with a speed speed in .peak_flow, return for a runoff coefficient c, rain i in mm/h and area a in .drought_class, return the word "none", "moderate" or "severe" for a normal rainfall normal and an actual rainfall actual.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…