Car A leaves a point at . Car B leaves the same point later at , the same way. You will make the program find A's head start when B leaves, how long B takes to catch A, and how far from the start they meet. Then it draws both cars' positions against time.
The idea. The head start is the distance A covers before B starts. B closes it at the difference of the speeds.
Your tasks.
head_start, the distance between the cars when B starts, in metres.t_catch, the time from B's start until it catches A, in seconds.x_meet, the distance from the start where they meet, in metres.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…