In order to answer this questions, let's suppose,
The time it takes for Sam and Joe to meet in hours= t
Joe's speed = 1.5miles/hour
Sam's speed = 2 miles/hour
Distance between Joe and Sam = 7 miles
When they meet Joe covers a distance of J miles and Sam covers S miles
Now,
J+S=7
J=1.5 miles/hour *t
S= 2 miles/hour * t
1.5t + 2t =7
3.5 t = 7
t=2 hours
It will take 2 hours for Sam and Joe to meet