question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_radio_s_shortest_wavelength do 4 kind :numerical 5 describes "A radio can tune in to any station in the 7.5 MHz to %{frequency} band. %{wavelength}, in metres?" 6 given frequency: "12 MHz" 7 asks wavelength: "What is the shortest wavelength of the corresponding wavelength band" 8 end
1 require_relative "../questions/a_radio_s_shortest_wavelength" 2 require_relative "../science/electromagnetic_waves/electromagnetic_wave" 3 4 solve :a_radio_s_shortest_wavelength , using: ElectromagneticWave do 5 objects :wave 6 7 take frequency: wave . frequency 8 9 wavelength = wave . wavelength 10 answer wavelength :, in: "m" , figures: 2 11 12 conclusion "Wavelength and frequency go inversely at the speed of light, so the highest frequency of the " \ 13 "band gives its shortest wavelength." 14 end
1 require_relative "../solutions/a_radio_s_shortest_wavelength" 2 3 play_with :a_radio_s_shortest_wavelength do 4 title "A Radio's Shortest Wavelength" 5 end