Answer
Scalar projection of $b$ onto $a$ is defined as:
$comp_ab=\dfrac{a \cdot b}{|a|}$
Vector projection of $b$ onto $a$ is defined as:
$proj_ab$=Scalar projection $\times$ unit vector in direction $a$
$=\dfrac{a \cdot b}{|a|} \times \frac{a}{|a|}$
$=\dfrac{a \cdot b}{|a|^2} a$
See the attached graph.
Work Step by Step
Scalar projection of $b$ onto $a$ is defined as:
$comp_ab=\dfrac{a \cdot b}{|a|}$
Vector projection of $b$ onto $a$ is defined as:
$proj_ab$=Scalar projection $\times$ unit vector in direction $a$
$=\dfrac{a \cdot b}{|a|} \times \frac{a}{|a|}$
$=\dfrac{a \cdot b}{|a|^2} a$
See the attached graph.