Write the method displaymenu and soundspeed- make sure that


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.
Now, write the following two methods:

The first one calledDisplayMenuthat takes no parameters and returns back an integer value. The method displays a menu allowing the user to select air, water, or steel. The method returns back an integer value that represents the user choice.Input validation: Make sure that this value is a numerical value, and it is a value only between 1-3. Remember input validation and verification from week 4, check the example given in the class under lecture/week4

The second one calledSoundSpeedthat takes one parameter -that represents the user choice from the method DisplauMenu- and it returns back an double value.The method asks the user to input the distance a sound wave will travel in the selected medium, then based on the parameter, the method calculates and displays the amount of time it will take for the sound to get through the chosen medium (round the answer to 4 decimal places).Input validation: Make sure that distance is a positive number.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write the method displaymenu and soundspeed- make sure that
Reference No:- TGS02386118

Now Priced at $15 (50% Discount)

Recommended (96%)

Rated (4.8/5)