The slope-intercept form:

m - slope
b - y-intercept → (0, b)
We have the point (0, 2). Therefore we have y-intercept 2 → b = 2.
The equation of the line is: w = mz + 2.
We have next point (1, 5). Substitute the coordinates of the point to the equation of the line:
subtract 2 from both sides

Answer: w = 3z + 2