Final answer:
The relative velocity of car A with respect to car B is 30 km/h in the same direction, and the relative velocity of car B with respect to car A is 30 km/h in the opposite direction.
Step-by-step explanation:
The relative velocity of car A with respect to car B can be found by subtracting the velocity of car B from the velocity of car A. Since both cars are moving in the same direction, we subtract the speeds. The relative velocity is 80 km/h - 50 km/h = 30 km/h in the same direction.
The relative velocity of car B with respect to car A can be found in the same way, subtracting the velocity of car A from the velocity of car B. Since car B is moving at 50 km/h and car A is moving at 80 km/h, the relative velocity is 50 km/h - 80 km/h = -30 km/h in the opposite direction.