if n is the number of seconds between lightning and thunder,the storm is n/ Miles away.

write a program that reads the number of seconds between lightning and thunder and report the distance of the storm rounded to two decimal places

It would be nice if your instructor actually knew the formula based on the speed of sound. To me, it is embarrassing

#include<iostream.h>

#include<conio.h>
int main ()
{
float noosec;
float distmiles;
cout<<"Enter number of sec between lightning and thunder:"<<endl;
cin>>noosec;
distmiles=noosec/5;
cout<<"Distance is:"<<endl;
cout<<distmiles<<endl;
return 0;

}
This is my view to your problem. You can whatsapp me for further query 00923215081005

To write a program that calculates the distance of a storm given the number of seconds between lightning and thunder, you can follow these steps:

Step 1: Prompt the user to enter the number of seconds between lightning and thunder.
Step 2: Read the input from the user and store it in a variable, let's call it "n".
Step 3: Calculate the distance by dividing the number of seconds by a constant value representing the speed of sound. In this case, let's assume the speed of sound is 343 meters per second.
Step 4: Convert the distance from meters to miles by dividing it by 1609.34 (since there are 1609.34 meters in a mile).
Step 5: Round the distance to two decimal places.
Step 6: Display the distance of the storm in miles.

Here's a Python program that implements this logic:

```python
# Step 1: Prompt the user for input
n = int(input("Enter the number of seconds between lightning and thunder: "))

# Step 3: Calculate the distance in meters
distance = n * 343

# Step 4: Convert meters to miles
distance = distance / 1609.34

# Step 5: Round the distance to two decimal places
distance = round(distance, 2)

# Step 6: Display the distance in miles
print("The storm is approximately", distance, "miles away.")
```

You can run this program and test it with different input values to see the resulting distance in miles.

To write a program that calculates the distance of a storm based on the number of seconds between lightning and thunder, you can follow these steps:

Step 1: Read the number of seconds from the user.
Step 2: Calculate the distance of the storm using the formula distance = seconds / 5, where the speed of sound is approximately 5 miles per second.
Step 3: Round the calculated distance to two decimal places.
Step 4: Display the rounded distance as the output.

Here's an example program in Python that implements these steps:

```python
# Step 1: Read the number of seconds from the user
seconds = float(input("Enter the number of seconds between lightning and thunder: "))

# Step 2: Calculate the distance of the storm
distance = seconds / 5

# Step 3: Round the calculated distance to two decimal places
rounded_distance = round(distance, 2)

# Step 4: Display the rounded distance as the output
print("The storm is approximately", rounded_distance, "miles away.")
```

You can run this program, enter the number of seconds, and it will calculate and display the distance of the storm rounded to two decimal places.