Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 2 0 points ) Problen 3 ( Use input coimiand, a while loop for error message and ontput coingand furint? The speed of a

(20 points) Problen 3(Use input coimiand, a while loop for error message and ontput coingand furint?
The speed of a sound wave is affected by the temperature of the alr. At 0C, the speed of a sound wave *331msec. The speed lacreases by approximately 0.8msec for every degree (in Celsius) above 0; thls is a reasorsably wcourate approxtmation for 0-80 degrees C. So, our equation for the speed in terns of a temperature C is:
speed =331+0.8C
Write a user defined function "soundtemp" that will prompt the user for a temperature in Celsius in the range fromi 0 to 80 inelusive and will calculate and print the speed of sound at that temperature. If the user eaters a temperature in that range, or an error messape if not. The format of the input and outpot isessages are givea below
% User prompt input
Enter a temp in the range 0 to 80:xx
%. If user enter a number below 0 or higher than B0 then display the belaw error message
Error in temperature. Try a different namber.
2 Desplay output
For a temperature of XX. the speed is xxxx
Disclaimer: Solve the code using the knowledge you learned fUse inpat command, a while loop for error ueskage and output command fprints. 'for loop', canmot be used lim your code) hi class without relying ou Al tools.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

If striving to meet schedule or budget isnt top priority, what is?

Answered: 1 week ago