Question: PYTHON: When sound travels through a gas, its speed depends primarily on the density of the medium. The less dense the medium, the faster the
PYTHON:
When sound travels through a gas, its speed depends primarily on the density of the medium. The less dense the medium, the faster the speedwill be. The following table shows the approximate speed of sound at 0 degrees centigrade, measured in meters per second, when traveling through carbon dioxide, air, helium, and hydrogen.---------------------------------------------Medium Speed (Meters per Second)-------------- -------------------------Carbon Dioxide 258.0Air 331.5Helium 972.0Hydrogen 1,270.0---------------------------------------------Write a program that displays a menu allowing the user to select one of these four gases. After a selection has been made, the user should enterthe number of seconds it took for the sound to travel in this medium fromits source to the location at which it was detected.The program should then report how far away (in meters) the source ofthe sound was from the detection location.Input Validation:Check that the user has selected one of the available menu choices.Do not accept times less than 0 seconds or more than 30 seconds.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
