Instead of using the equation , this program lets a stone fall in tiny steps of time. In every step it falls a little and speeds up a little. You will make the steps work, compare the result with the equation, and see how small the difference is.
The idea. In a tiny time , the stone falls and its speed grows by . Repeat that many times and you have the whole fall. The equation gives the same answer in one go.
Your tasks.
exact, the distance the equation gives after t_end seconds.difference, the equation's answer minus the stepping answer.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…