Question

Goal: For n number of cars, calculate the average speed given the

distance travelled and time taken.

Speed is calculated by dividing distance traveled (miles) by time (hr) taken.

Speed = Distance/Time

To calculate the average speed for n cars,

average speed = total speed of n cars / n

Summary

Your program should do the following:

1. Get Inputs for each car:

• distance traveled (in miles)

• time taken (in hours)

2. Calculate the speed for each car

3. Display the speed for each car.

4. Calculate the average speed of the 7 cars and display it (outside the loop)

Question image 1