How much work does it take to stretch a spring? You will make the program add up thin strips under the force-position graph, and check the answer against .
The idea. The work of a changing force is the area under its graph: . For a spring, , and the area from to is .
Your tasks.
x.area(x, F) to find the work to stretch the spring from to .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…