hello,
providing you the code for your problem:-
code starts here:-
#include<iostream>
using namespace std;
int main()
{
int route[]={1,2,3,4,5};
int distance[]={560,440,490,530,370};
float duration[]={10.3,8.2,9.1,10.1,7.5};
float max=0.0;
int route_max;
cout<<"Route"<<"\t"<<"Avg
Speed(mi/hr)"<<endl;
for(int i=0;i<5;i++)
{
if((float)(distance[i]/duration[i])>max)
{
max=(float)(distance[i]/duration[i]);
route_max=i+1;
}
cout<<i+1<<"\t"<<(float)(distance[i]/duration[i])<<endl;
}
cout<<"route "<<route_max<<" has the highest
average speed of "<<max<<" mi/hr";
}
code ends here:-
providing you the output snapshot :-
i hope i was able to solve your problem to a greater extent, please feel free to comment your queries, Please consider my efforts and upvote my solution.
Thanku:)
c++ 2) The following table gives data for the distance traveled along five truck routes and...