I show you a way to write a function for '
travel distance at constant speed'. I suppose it's just enough to make you figure out how to write the requested one.
Travel distance at constant speed = (v x t)
v = constant vehicle speed
t = elapsed time.
double travel_distance(double v, double t)
{
double distance = v * t;
return distance;
}