You can use the equation 
V_xf = V_xi + a_x(t) 
V_xf = 20.0m/s 
V_xi = 0m/s 
ax = 2.0 t
Thus, solve for t and get 10seconds and then take 5 seconds to break after 20 seconds of driving so for 
a) 10 + 20 + 5 = 35 seconds
for part b) 
You can use the formula 
Delta x/Delta t = average velocity 
 
Need to find xf, knowing xi = 0 
Thus, use the formula 
 x_f = x_i + V_xi(t) + (1/2)a_x(t)^(2) 
x_f = 0 + 0(10) + (1/2)(2.0)(10)^(2)
 x_f = 100m 
 
so for the first 10 seconds the truck traveled 100ms At a speed of 20m/s 
20m/s = xm/20s 20*20 = x 
x = 400 
 
thus we have 100+400 = 500m then it slows down from 500m to x_f 
 
thus I use the equation 
x_f = x_i + (1/2)(V_xf + V_xi)t 
x_f = 500 + (1/2)(0 + 20)(5) x_f = 500 + 50 
x_f = 550 
 
therefore the total distance traveled is 550m
to calculate average velocity 
550/35 = 16m/s 
thus V_xavg = 16m/s