a) You can calculate the distances or simply visualize it:
(The code of above visualization is available here)
Based on the above visualization, 3 closest neighbors are blue points. Therefore, the predicted class is blue.
b) The 3 closest neighbors are data points: $(0,1,\$50)$, $(1,0,\$30)$, and $(1,2,\$40)$. Therefore, the estimated price is the mean of the target values $\frac{50+40+30}{3}=\$40$