Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Screen Shot 2017-10-10 at 3.08.33 PM You will be calculating the number of seconds it will take for sound to travel though a medium.
C++
Screen Shot 2017-10-10 at 3.08.33 PM
You will be calculating the number of seconds it will take for sound to travel though a medium. The values you will use are as follows: Medium Speed (feet per second) Air Water4,900 Steel 16,400 1,100 Your program will display a menu of three items: Select the medium that sound is traveling through: 1 Air 2 Water 3 Steel Your program will then read in an unsigned int value Use a switch statement to process the menu value you have just read in. If the value is invalid (0, or greater than 3) display the following error message: The menu value is invalid. Please run the program again If the menu value is valid, read in the distance (in feet) that sound will travel in the medium selected. This will look as follows: Enter distance (in feet) If the distance is less than or equal to zero output the message The distance must be greater than zero If the distance is greater than zero, calculate the speed and output the following (this is for air): Air: 1000.0 ft Traveled for 0.9 seconds Note that the output values have one digit of precisionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started