Answer: Dog's speed = (20 + 35) /12 = 4.583 m/s
Dog's velocity = (20-35)/12 = -1.25 m/s
Explanation: Speed is a scalar quantity so we don't care about direction which means we add the magnitude of both the directions i.e. east and west.
About the velocity, it's a vector quantity. So, we must be very careful with the directions and signs. In cartesian coordinates system, we generally take the right side of origin as the positive x-axis and the left side of origin as the negative x-axis. So, considering the same fact, we consider east as positive side and west as the negative side.
Therefore, when we add 20m + (-35m), we get = -15m and you already have the time period of 12 s.