Let's say the x is the miles per hour for car A, and x+10 is the number of miles for car B(says in the problem/question)
Since Car A travels 120 miles when Car B travels 150 miles, we can do:\(\frac{120}{x}=\frac{150}{x+10}\).
Cross multiplying, we have 120(x+10)=150x- 120x+1200=150x
We get 30x=1200-x=40
Thus, Car A travels 40 mph, and Car B travels 50 mph.