$(a)$ Acceleration is the slope of the velocity-time graph.
For car $B$, between $t = 2 \, s$ and $t = 4 \, s$, the velocity changes from $20 \, m/s$ to $40 \, m/s$.
$a = \frac{v_2 - v_1}{t_2 - t_1} = \frac{40 - 20}{4 - 2} = \frac{20}{2} = 10 \, m/s^2$.
$(b)$ Both cars have the same velocity where their graphs intersect. Looking at the graph, the intersection point is at $t = 2 \, s$ (velocity $= 20 \, m/s$) and $t = 6 \, s$ (velocity $= 60 \, m/s$).
$(c)$ Distance travelled is the area under the velocity-time graph.
For car $A$: The area is a trapezoid from $t = 1$ to $t = 4$ plus a rectangle from $t = 4$ to $t = 8$.
Area $= (\frac{1}{2} \times (4 - 1) \times 60) + (60 \times (8 - 4)) = (\frac{1}{2} \times 3 \times 60) + (60 \times 4) = 90 + 240 = 330 \, m$.
For car $B$: The area is a triangle from $t = 0$ to $t = 8$.
Area $= \frac{1}{2} \times \text{base} \times \text{height} = \frac{1}{2} \times 8 \times 80 = 320 \, m$.
$(d)$ After $8 \, s$, car $A$ has travelled $330 \, m$ and car $B$ has travelled $320 \, m$.
Therefore, car $A$ is ahead by $330 - 320 = 10 \, m$.