#include <iostream>
using namespace std;
int main(){
float X, x_Speed, Y, y_Speed, z_Speed, z_Minutes;
cout<<"Input X (km): ";
cin>>X;
cout<<"Input x_Speed (m/s): ";
cin>>x_Speed;
cout<<"Input Y (km): ";
cin>>Y;
cout<<"Input y_Speed (km/h): ";
cin>>y_Speed;
cout<<"Input z_Speed (km/h): ";
cin>>z_Speed;
cout<<"Input z_Minutes: ";
cin>>z_Minutes;
float total_distance = X + Y + z_Speed * z_Minutes/60;
float total_time = X / (x_Speed * 3600/1000) + Y / y_Speed + z_Minutes/60;
cout<<"Average speed in km/h = "<< total_distance/total_time<<endl;
return 0;
}
Comments
Leave a comment