question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :air_molecules_in_a_room do 4 kind :numerical 5 describes "%{molecules} (inclusive of oxygen, nitrogen, water vapour and other constituents) in a room of capacity " \ 6 "%{volume} at a temperature of 27 °C and %{pressure} pressure?" 7 given volume: "25.0 m3" 8 given pressure: "1 atm" 9 asks molecules: "Estimate the total number of air molecules" 10 end
1 require_relative "../questions/air_molecules_in_a_room" 2 require_relative "../science/kinetic_theory/moles" 3 4 solve :air_molecules_in_a_room , using: Moles do 5 objects :air 6 7 take volume: air . volume 8 take pressure: air . pressure 9 10 deduce_from "a temperature of 27 °C" , air . temperature => "300 K" 11 12 molecules = air . molecules 13 answer molecules :, figures: 2 14 15 conclusion "The ideal gas law counts the moles from the pressure, volume and temperature alone, whatever mix of " \ 16 "molecules the air is, and each mole holds Avogadro's number of them." 17 end
1 require_relative "../solutions/air_molecules_in_a_room" 2 3 play_with :air_molecules_in_a_room do 4 title "Air Molecules in a Room" 5 end