Wednesday
April 16, 2014

Homework Help: writting a program

Posted by sarah on Thursday, February 23, 2012 at 5:37am.

Speed of Sound. Sound travels through air as a result of collisions between the molecules in the air. The temperature of the air affects the speed of the molecules, which in turn affects the speed of sound. The velocity of sound in dry air can be approximated by the formula:

     velocity = 331.3 + 0.61 × T

where Tc is the temperature of the air in degrees Celsius and the velocity is in meters/second.

Write a program that prompts the user for a starting and an ending temperature. Within this temperature range, the program should output the temperature and the corresponding velocity in one degree increments. In the example below, the user entered 0 as the start temperature and 2 as the end temperature:
Enter the starting temperature, in degrees Celsius:  0
Enter the ending temperature, in degrees Celsius:  2
At 0 degrees Celsius the velocity of sound is 331.3 m/s
At 1 degrees Celsius the velocity of sound is 331.9 m/s
At 2 degrees Celsius the velocity of sound is 332.5 m/s

Input Details: The input will consist of two integers, both responses to program prompts.

Output Details: The program uses the prompts shown in the example above. The output percentage must have one digit past the decimal point.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Physics - A hammer taps on the end of a 8.13m long metal bar at room temperature...
Physics - A hammer taps on the end of a 4.20 m long metal bar at room ...
physics - A hammer taps on the end of a 4.02 m long metal bar at room ...
physics - A hammer taps on the end of a 3.32 m long metal bar at room ...
9th grade - Use the following Info. At sea level the speed of sound in air is ...
Physics - Sound - A sound wave travels in air at a frequency of 500 Hz. If part ...
physics - At 0°C sound travels through air at a speed of 330 m/s. If a sound ...
physics - A sound wave travels in air at a frequency of 500 Hz. If part of the ...
Physics - I did a lab in which we were to find the 1st resonance and 2nd ...
physics - An explosion occurs at the end of a pier. The sound reaches the other ...

Search
Members