171k views
2 votes
Two cars A and B leave an intersection at the same time. Car A travels west at an average speed of x miles per hour and car B travels south at an average speed of y miles per hour. Write a program that prompts the user to enter the average speed of both the cars and the elapsed time (in hours and minutes) and outputs the (shortest) distance between the cars.

User Jbenowitz
by
4.6k points

1 Answer

0 votes

Answer:

Distance between A & B, dAB, is hypotenus.

dAB²=dA²+dB²

A'=70 mph, B'=55mph, (convert t to hours)

dA=A'•t, dB=B'•t

dAB=√((70t)²+(55t)²)

Step-by-step explanation:

Distance between A & B, dAB, is hypotenus.

dAB²=dA²+dB²

A'=70 mph, B'=55mph, (convert t to hours)

dA=A'•t, dB=B'•t

dAB=√((70t)²+(55t)²)

User Pedro Arantes
by
4.7k points