Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

image text in transcribed

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.986

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Compare and contrast skimming pricing and price gouging.

Answered: 1 week ago

Question

1. How do listening and hearing diff er?

Answered: 1 week ago

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago

Question

=+What is the most that you should pay to complete development?

Answered: 1 week ago

Question

=+development and make the product, should you go ahead and do so?

Answered: 1 week ago