Question: The following table shows the approximate speed of sound in air, water, and steel: Write a program that asks the user to enter air, water,

The following table shows the approximate speed of sound in air, water, and steel: 

Medium Air Water Steel Speed 1,100 feet per second 4,900 feet per

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 amount of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: 

Time = Distance / 1,100 

You can calculate the amount of time it takes sound to travel in water with the following formula: 

Time = Distance / 4,900 

You can calculate the amount of time it takes sound to travel in steel with the following formula:

Time = Distance / 16,400

Medium Air Water Steel Speed 1,100 feet per second 4,900 feet per second 16,400 feet per second

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ANSWER medium inputEnter air water or steel distance floatinputE... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Starting Out With Java From Control Structures Questions!