Step 1: Find the class marks.
\[
2.5,\;7.5,\;12.5,\;17.5,\;22.5
\]
Step 2: Compute \(\sum f\) and \(\sum fx\).
\[
\sum f=2+k+6+4+1=13+k.
\]
Also,
\[
\sum fx
=
2(2.5)+k(7.5)+6(12.5)+4(17.5)+1(22.5)
\]
\[
=5+7.5k+75+70+22.5
\]
\[
=172.5+7.5k.
\]
Step 3: Use the mean formula.
Given,
\[
\frac{172.5+7.5k}{13+k}=12.5.
\]
Therefore,
\[
172.5+7.5k
=
162.5+12.5k.
\]
\[
10=5k.
\]
\[
k=2.
\]
Step 4: Final conclusion.
\[
\boxed{k=2}
\]
Hence, the correct option is \(\boxed{(B)}\).