question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :area_of_a_sheet do 4 kind :numerical 5 describes "A sheet is measured as %{length} ± %{length_error} cm long and %{width} ± %{width_error} cm wide. Its area is " \ 6 "about 163.6 cm². %{error}?" 7 given length: 16.2 8 given length_error: 0.1 9 given width: 10.1 10 given width_error: 0.1 11 asks error: "To within how many square centimetres is that known" 12 end
1 require_relative "../questions/area_of_a_sheet" 2 require_relative "../science/units_and_measurement/uncertainty" 3 4 solve :area_of_a_sheet , using: Uncertainty do 5 take length: :a , length_error: :Delta_a , width: :b , width_error: :Delta_b 6 take error: :Delta_p 7 answer find_value ( :error , within: 0.5 ) 8 9 conclusion "In a product the relative errors add, so the product is less certain than either " \ 10 "measurement." 11 end
1 require_relative "../solutions/area_of_a_sheet" 2 3 play_with :area_of_a_sheet do 4 title "The Area of a Sheet" 5 end