question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_coulomb_one_electron_at_a_time do 4 kind :numerical 5 describes "If %{rate} electrons move out of a body to another body every second, %{time} to get a total charge of " \ 6 "%{charge} on the other body?" 7 given rate: "1e9 s-1" 8 given charge: "1 C" 9 asks time: "how much time is required" 10 end
1 require_relative "../questions/a_coulomb_one_electron_at_a_time" 2 require_relative "../science/electric_charges_and_fields/electric_charge" 3 4 solve :a_coulomb_one_electron_at_a_time , using: ElectricCharge do 5 objects :other_body 6 7 take rate: other_body . charges_a_second 8 take charge: other_body . charge 9 10 time = other_body . charging_time 11 answer time :, in: "y" , figures: 3 12 13 conclusion "A coulomb is a vast number of electrons, so even a billion a second takes about two " \ 14 "centuries to gather one." 15 end
1 require_relative "../solutions/a_coulomb_one_electron_at_a_time" 2 3 play_with :a_coulomb_one_electron_at_a_time do 4 title "A Coulomb One Electron at a Time" 5 end