Answer
speed of boat: $10\text{ mph}$
speed of current: $2\text{ mph}$
Work Step by Step
Let $s$ be the speed of the boat in still water and let $c$ be the speed of the current.
The distance ($d$), rate ($r$), and time ($t$) of objects in uniform motion is related by the equation
$$
d=rt
.$$
With a distance of $24\text{ mi}$ going downstream in $2\text{ h}$, then
$$\begin{aligned}
d&=rt
\\
24&=(s+c)2
\\
s+c&=12
.&\text{Eqn $(1)$}\end{aligned}$$
With a distance of $16\text{ mi}$ going upstream in $2\text{ h}$, then
$$\begin{aligned}
d&=rt
\\
16&=(s-c)2
\\
s-c&=8
.&\text{Eqn $(2)$}\end{aligned}$$
Equations $1$ and $2$ form a system of linear equations. Adding these equations results in
$$\begin{aligned}
2s&=20
\\
s&=10
.\end{aligned}
$$ Hence, the speed of the boat in still water, $s$, is $10\text{ mph}$.
Substituting $s=10$ in Eqn ($1$) results in
$$\begin{aligned}
10+c&=12
\\
c&=2
.\end{aligned}$$Hence, the speed of the current, $c$, is $2\text{ mph}$.