Question
Instructions in C++ The program in Example 8-7 outputs the average speed over the intervals of length 10. Modify the program so that the user
Instructions in C++
The program in Example 8-7 outputs the average speed over the intervals of length 10. Modify the program so that the user can store the distance traveled at the desired times, such as times 0, 10, 16, 20, 30, 38, and 45. The program then computes and outputs the average speed of the object over the successive time intervals specified by the time when the distance was recorded. For example, for the previous list of times, the average speed is computed over the time intervals 0 to 10, 16 to 20, 20 to 30, 30 to 38, and 38 to 45.
Instructions for Example 8-7 have been included for your convenience.
Example 8-7
Suppose that the distance traveled by an object at time t = a1 is d1 and at time t = a2 is d2, where a1 < a2. Then the average speed of the object from time a1 to a2, that is, over the interval [a1, a2] is (d21)(a2 - a1). Suppose that the distance traveled by an object at certain 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started