Let speed of car = v
speed of truck = v - 10
distance = speed x time
for car
315 = v x t
315 = vt
t = 315/v ------------------ 1
for truck
245 = (v - 10) x t ----------- 2
Next substitute equation 1 from car tp equation 2 in the truck.
The average speed of car = 45 miles per hour
The average speed of truck = 45 - 10 = 35 miles per hour