Question
C++ requirements Your program will read in the menu number as an unsigned int value . The menu item must be processed using a switch
C++ requirements
Your program will read in the menu number as an unsigned int value .
The menu item must be processed using a switch statement.
The distance and all calculations need to be done using double values.
The source file must be named lesson5part1.cpp or zyBooks won't allow you to upload the file.
Failure to follow the C++ requirements could reduce the points received from passing the tests.
General overview
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:
The 10 points for coding style will be based on the following guidelines:
Comments at the start of your programming with a brief description of the purpose of the program.
Comments throughout your program
If you have any variables they must have meaningful names.
Wc.liUII 1 SIKNN (ud IKS :a3%NKI) Air ater 4,900 Steel 16,400 et per second) 1,100 Your program will display a mernu of three ilems: Select the medium that aound ia traveling through: Air 2 Water 3 Steel After displaying the menu your program will read in the menu item as 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 progran 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 d3tanoe in feet) The distance value must be read into a variable cf type double 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 airy: Air: 1000.000 ft Tzaveled or 0.909 seconds Note that the output values have three digits of precision. Here are two sample runs (with inputy Run 1 567544.986Step 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