Question
Java
The speed of sound ( Java)
l llll to order that they race. The program should display the the time, in minutes, it took names of the hnish and finished. runners in the 12. The speed of sound The following table shows the approximate speed of sound water and steel: in air, Medium 1,100 feet per second Wate 4.900 feet per second Steel 16,400 feet per "cond Write a program that asks the user to enter air", water, or "steel", and the distance that a sound wave will travel in the medium. The program should then display the of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: Time Distanvr 11,100 You can calculate the amount of time it takes sound to travel in water with the follow- ing formulat Time Distance /4,900 You can calculate the amount of time it takes sound to travel in steel with the follow- ing formular Time Distance 16,400
Explanation / Answer
Enter the medium (Air/Water/Steel):Air
Enter the distance travelled:110
Distance Travelled:0.1 feet
Enter the medium (Air/Water/Steel):Stee
Invalid medium.
Enter the medium (Air/Water/Steel):Steel
Enter the distance travelled:10000
Distance Travelled:0.6097560975609756 feet