Menu

[Solved] C Program Example 8 7 Outputs Average Speed Intervals Length 10 Modify Program User Store Q37268445

C++

The program in Example 8-7 outputs the average speedover the intervals of length 10. Modify the program so that theuser can store the distance traveled at the desired times, such astimes 0, 10, 16, 20, 30, 38, and 45. The program then computes andoutputs the average speed of the object over the successive timeintervals specified by the time when the distance was recorded. Forexample, for the previous list of times, the average speed iscomputed over the time intervals 0 to 10, 16 to 20, 20 to 30, 30 to38, and 38 to 45.

Instructions for Example 8-7 have been included foryour convenience.

Example 8-7

Suppose that the distance traveled by an object at time t =a1 is d1 and at time t = a2 isd2, where a1 < a2. Then theaverage speed of the object from time a1 toa2, that is, over the interval [a1,a2] is (d2</sub – d1)(a2 -a1). Suppose that the distance traveled by an object atcertain times is given by the following table:

Time   Distance
0   0  
10   18  
20   27  
30   38  
40   52  
50   64

Then the average speed over the interval [0, 10] is (18 – 0)/(10- 0) = 1.8, over the interval [10, 20] is (27 – 18)/(20 – 10) =0.9, and so on.

Expert Answer


Answer to C++ The program in Example 8-7 outputs the average speed over the intervals of length 10. Modify the program so that the… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *