Step 1: Write the given vector and direction vector.
Given vector is
\[
\vec{P}=3\hat{i}+4\hat{j}
\]
The direction vector is
\[
\vec{a}=\hat{i}+2\hat{j}
\]
Step 2: Find the unit vector along the given direction.
Magnitude of \(\vec{a}\) is
\[
|\vec{a}|=\sqrt{1^2+2^2}
\]
\[
|\vec{a}|=\sqrt{5}
\]
Therefore, unit vector along \(\vec{a}\) is
\[
\hat{a}=\frac{\hat{i}+2\hat{j}}{\sqrt{5}}
\]
Step 3: Find the scalar component.
The component of \(\vec{P}\) along \(\vec{a}\) is
\[
\vec{P}\cdot \hat{a}
\]
\[
=(3\hat{i}+4\hat{j})\cdot \frac{\hat{i}+2\hat{j}}{\sqrt{5}}
\]
\[
=\frac{3(1)+4(2)}{\sqrt{5}}
\]
\[
=\frac{3+8}{\sqrt{5}}
\]
\[
=\frac{11}{\sqrt{5}}
\]
Step 4: Final conclusion.
Therefore,
\[
\boxed{\frac{11}{\sqrt{5}}}
\]