question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :heavier_than_water do 4 kind :numerical 5 describes "Lead is %{times} times as dense as water, and water is %{water_density}. %{density}, in kilograms per cubic metre?" 6 given times: 11.3 7 given water_density: "1000 kg/m3" , as: "1000 kg per cubic metre" 8 asks density: "What is the density of lead" 9 end
1 require_relative "../questions/heavier_than_water" 2 require_relative "../science/units_and_measurement/dimensions" 3 4 solve :heavier_than_water , using: Dimensions do 5 take times: :rho_rel , water_density: :rho_w 6 take density: :rho 7 answer find_value ( :density , figures: 3 ) 8 9 conclusion "Relative density is a ratio with no unit: it says how many times denser than water a " \ 10 "thing is, whatever units the densities are in." 11 end
1 require_relative "../solutions/heavier_than_water" 2 3 play_with :heavier_than_water do 4 title "Heavier than Water" 5 end