Seven things are dropped into a tank of water: cork, pine wood, ice, hard rubber, aluminium, iron and gold. You will make the program decide which float, how much of each floater stays under the surface, and what a spring balance would read for of each sinker held under water.
The idea. A body floats if it is less dense than water, with the fraction of its volume under. A sinker of mass held under water seems to weigh .
Your tasks.
floats, an array that is True for the things that float.under, the fraction of each one's volume under water (a sinker is all under: ).reading, what a balance shows for of each held under water (a floater reads ).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…