The speed of sound The following table shows the approximate speed of sound in a
ID: 3762642 • Letter: T
Question
The speed of sound The following table shows the approximate speed of sound in air,water,and steel Medium Speed Air 1,100 feet per second Water 4,900 feet per second Steel 16,400 feet per second Design a program(Pseudo code) that displays a menu allowing the user to select air, water, or steel. After the user has made a selection, he or she should be asked to enter the number of seconds the sound will travel in the selected medium. The program(pseudo code) should then display the distance the sound will travel
Explanation / Answer
Pseudo Code:
Display Menu
Menu
====
Air
Water
Steel
Request user to select the choice of medium from Menu
Capture the "choice of medium" made by user
Request user to enter the number of seconds the sound will travel in the selected medium.
Capture the "number of seconds" input by the user
Calculate distance travelled by sound using the below information:
distance travelled by sound = (speed of sound in medium) * (number of seconds) feet
speed of sound in Air =1,100 feet per second
speed of sound in Water =4,900 feet per second
speed of sound in Steel =16,400 feet per second
if "choice of medium" = Air
distance travelled by sound in feet = (speed of sound in Air) * ("number of seconds")
if "choice of medium" = Water
distance travelled by sound in feet = (speed of sound in Water) * ("number of seconds")
if "choice of medium" = Steel
distance travelled by sound in feet = (speed of sound in Steel) * ("number of seconds")
Display the "distance travelled by sound" in feet
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.