Two people eat the same sweet breakfast, and the sugar in their blood starts at mg/dL. One has a pancreas that works well. The other makes too little insulin. You will write the rule that brings the sugar back, follow both people for four hours, and compare them. Then the program draws both curves.
The idea. In every half hour, insulin removes a share of the extra sugar above the normal level of mg/dL: the next level is sugar - strength * (sugar - normal).
Your tasks.
next_level return the level half an hour later, by the rule above.above to the number of readings after the start at which the person with weak insulin is still above mg/dL.below_time to the first time, in minutes, at which the healthy level is below mg/dL.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…