Answer:
#include <iostream>
using namespace std;
int main(){
double miles[10] = {240.5, 300, 189.6, 310.6, 280.7, 206.9, 199.4, 160.3, 177.4, 192.3};
double gallons[10] = {10.3, 15.6, 8.7, 14, 16.3, 15.7, 14.9, 10.7, 8.3, 8.4};
double mpg[10];
for (int i = 0; i < 10; i++){
mpg[i] = miles[i]/ gallons[i];
cout << "mpg: " << mpg[i] << endl;
}
}
Explanation:
The C++ source code declares three arrays miles, gallons and mpg with an array length of 10. The gallons and miles arrays are assigned 10 array items each and they are used to push values to the mpg array in the for loop statement. The result of each item in the mpg array is displayed on the screen.