The following shows the approximate speed of sound in air, water,and steel. Air
ID: 3616888 • Letter: T
Question
The following shows the approximate speed of sound in air, water,and steel. Air 1100 feet per second Water 4900 feet per second Steel 16,400 feet per secondDesign a class that stores in a distance field the distance,in feet, traveled by a sound wave. The class should have theappropriate accessor and mutator methods for this field. Inaddition, the class should have the following methods. -getSpeedInAir. This method should return the number ofseconds it would take a sound wave to travel, in air, the distancestored in the distance field. The formula to calculate theaount of time it will take the sound wave to travel the distance inair is Time= distance/1100
-getSpeedinWater. This method will do the same as abovebut for water using Time = distance/4900
-getSpeedinSteel same as above using Time =distance/16400
Write a program to demonstrate the class. The program shoulddisplay a menu allowing the user to select air,water, or steel. Once the user has made a selection, he or she should be askedto enter the distance a sound wave will travel in the selectedmedium. The program will then display the amount of time itwill take. Check that the user has selected one of theavailable choices from the menu. Air 1100 feet per second Water 4900 feet per second Steel 16,400 feet per second
Design a class that stores in a distance field the distance,in feet, traveled by a sound wave. The class should have theappropriate accessor and mutator methods for this field. Inaddition, the class should have the following methods. -getSpeedInAir. This method should return the number ofseconds it would take a sound wave to travel, in air, the distancestored in the distance field. The formula to calculate theaount of time it will take the sound wave to travel the distance inair is Time= distance/1100
-getSpeedinWater. This method will do the same as abovebut for water using Time = distance/4900
-getSpeedinSteel same as above using Time =distance/16400
Write a program to demonstrate the class. The program shoulddisplay a menu allowing the user to select air,water, or steel. Once the user has made a selection, he or she should be askedto enter the distance a sound wave will travel in the selectedmedium. The program will then display the amount of time itwill take. Check that the user has selected one of theavailable choices from the menu.