question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_box_and_two_nuggets do 4 kind :numerical 5 describes "A box weighs %{box}. Two gold nuggets of 20.15 g and 20.17 g, together %{nuggets}, are " \ 6 "put into it. %{weight}, in kilograms, to the right figures?" 7 given box: "2.3 kg" 8 given nuggets: "0.04032 kg" 9 asks weight: "What does the box weigh now" 10 end
1 require_relative "../questions/a_box_and_two_nuggets" 2 require_relative "../science/units_and_measurement/uncertainty" 3 4 solve :a_box_and_two_nuggets , using: Uncertainty do 5 take box: :a , nuggets: :b 6 take weight: :t 7 answer find_value ( :weight , figures: 2 ) 8 9 conclusion "A sum can be no more exact than its roughest part. It keeps the fewest decimal " \ 10 "places of what went into it, and here the gold is lost in the roughness of the box's " \ 11 "weighing." 12 end
1 require_relative "../solutions/a_box_and_two_nuggets" 2 3 play_with :a_box_and_two_nuggets do 4 title "A Box and Two Nuggets" 5 end