The approximate speed of sound in air, water and steel is: Medium Speed Air 1,100 feet per second Water 4,900 feet per second Steel 16,400 feet per second The time is takes for sound to travel through a medium is computed with the formula: Time = Distance / Speed Write a program that asks the user to enter "A" for air, "W" for water or "S" for steel and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You should use a switch statement to select the divisor to use in your formula. Your output should be formatted as seconds to four decimal places. Your program should be properly formatted and commented.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
The approximate speed of sound in air, water and steel is:
Medium | Speed |
Air | 1,100 feet per second |
Water | 4,900 feet per second |
Steel | 16,400 feet per second |
The time is takes for sound to travel through a medium is computed with the formula: Time = Distance / Speed
Write a
You should use a switch statement to select the divisor to use in your formula. Your output should be formatted as seconds to four decimal places.
Your program should be properly formatted and commented.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images