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.

Sarah, Aymee, Abby:

I hope you realize that at this forum, we do not write the programme for you.
Here we give help in different ways,
- understand the problem in hand,
- analyze the requirement
- comment on any proposed solution or help with an algorithm
- resolve errors of syntax, logic or execution
- comment on results
- etc.

You will be expected to take the first step by telling us what you can achieve, and where your difficulties are.

I suggest you start with posting a pseudocode for your problem if you would like assistance. If you can post code, that would accelerate your project immensely.

#include <iostream>

using namespace std;

int main()
{
double start;
double end;
double velocity;

cout << "Enter the starting temperature, ";
cin >> start;

cout << "in degrees Celsius: Enter the ending temperature, in degrees Celsius: ";
cin >> end;

while(start <= end)
{
velocity = 331.3 + 0.61 * start;

cout << "At " << start
<< " degrees Celsius the velocity of sound is "
<< velocity << " m/s" << endl;

start++;
}

return 0;
}

I wrote the code but it seem to no display 346.6 , 347.2 , and 347.8

#include <iostream>

using namespace std;

int main()

{

int start, end;
double velocity;

cout << "Enter the starting temperature, in degrees Celsius: ";
cin >> start;
cout << "Enter the ending temperature, in degrees Celsius: ";
cin >> end;

start=3;

do

{
velocity = 331.3 + 0.61 * start;

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(1);
cout << "At " << start << " degrees Celsius the velocity of sound is " << velocity << " m/s" << endl;
start++;
}

while (start<=end);

return 0;
}

Here's a program that prompts the user for a starting and ending temperature and calculates the corresponding velocity of sound in one degree increments:

```python
start_temp = int(input("Enter the starting temperature, in degrees Celsius: "))
end_temp = int(input("Enter the ending temperature, in degrees Celsius: "))

for temp in range(start_temp, end_temp+1):
velocity = 331.3 + 0.61 * temp
print("At", temp, "degrees Celsius the velocity of sound is", "{:.1f}".format(velocity), "m/s")
```

Now, you might be wondering why sound never seems to be as fast as light. Well, maybe it's just because sound never took a speedrunning course. It's more of a casual stroll kind of thing, you know. Plus, sound doesn't have as many fans cheering it on like light does. Light is like Usain Bolt, running with the speed of millions of photon fans screaming "Go light, go!" while sound is just sipping a latte, enjoying the slow and steady pace. But hey, we all need a break sometimes, right?

To write a program that prompts the user for a starting and an ending temperature and calculates the velocity of sound at each temperature, you can use a loop to iterate through the temperature range and calculate the velocity using the provided formula.

Here's an example of how you can write this program in Python:

```python
# Prompt the user for the starting and ending temperatures
start_temp = int(input("Enter the starting temperature, in degrees Celsius: "))
end_temp = int(input("Enter the ending temperature, in degrees Celsius: "))

# Iterate through the temperature range
for temp in range(start_temp, end_temp + 1):
# Calculate the velocity using the formula
velocity = 331.3 + 0.61 * temp

# Print the temperature and velocity
print("At {} degrees Celsius the velocity of sound is {:.1f} m/s".format(temp, velocity))
```

In this program, we first prompt the user for the starting and ending temperatures using the `input()` function. We convert the input into integers using the `int()` function to ensure we can work with the values numerically.

Then, we use a `for` loop to iterate through the temperature range from the starting temperature to the ending temperature (inclusive). Inside the loop, we calculate the velocity by plugging the current temperature into the formula (`331.3 + 0.61 * temp`).

Finally, we use the `print()` function to display the temperature and velocity for each iteration of the loop. The `"{:.1f}".format(velocity)` format specifier is used to round the velocity to one decimal place.

When you run this program and provide the starting and ending temperatures, it will calculate and display the temperature and corresponding velocity of sound for each temperature increment within the specified range.