The Speed of Sound in Gases
When traveling through a gas, the speed of sound depends primarily on the density of the medium. The less dense the medium, the faster the speed will be. The following table shows the approximate speed of sound at 0 degrees Celsius, measured in meters per second, when traveling through carbon dioxide, air, helium, and hydrogen.
Write a program that displays a menu allowing the user to select one of these four gases. After a valid selection has been made, the program should ask the user to enter the number of seconds (0 to 30) it took for the sound to travel in this medium from its source to the location at which it was detected. The program should then report how far away (in meters) the source of the sound was from the detection location.
Input Validation: If the use enters an invalid menu choice the program should display an error message instead of prompting for the number of seconds.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.