We are given that:
\[
\cos \theta = \frac{4}{5}.
\]
We can use the Pythagorean identity to find \( \sin \theta \). The identity is:
\[
\sin^2 \theta + \cos^2 \theta = 1.
\]
Substitute \( \cos \theta = \frac{4}{5} \) into this equation:
\[
\sin^2 \theta + \left( \frac{4}{5} \right)^2 = 1,
\]
\[
\sin^2 \theta + \frac{16}{25} = 1 \quad \Rightarrow \quad \sin^2 \theta = 1 - \frac{16}{25} = \frac{25}{25} - \frac{16}{25} = \frac{9}{25}.
\]
Thus:
\[
\sin \theta = \frac{3}{5}.
\]
Now, we need to find \( \sin \theta \cos \theta + \tan^2 \theta \). First, calculate \( \sin \theta \cos \theta \):
\[
\sin \theta \cos \theta = \frac{3}{5} \times \frac{4}{5} = \frac{12}{25}.
\]
Next, calculate \( \tan \theta \). We know that:
\[
\tan \theta = \frac{\sin \theta}{\cos \theta} = \frac{\frac{3}{5}}{\frac{4}{5}} = \frac{3}{4}.
\]
Now, calculate \( \tan^2 \theta \):
\[
\tan^2 \theta = \left( \frac{3}{4} \right)^2 = \frac{9}{16}.
\]
Finally, add \( \sin \theta \cos \theta \) and \( \tan^2 \theta \):
\[
\sin \theta \cos \theta + \tan^2 \theta = \frac{12}{25} + \frac{9}{16}.
\]
To add these fractions, find a common denominator. The least common denominator of 25 and 16 is 400. Rewrite the fractions:
\[
\frac{12}{25} = \frac{192}{400}, \quad \frac{9}{16} = \frac{225}{400}.
\]
Now, add the fractions:
\[
\frac{192}{400} + \frac{225}{400} = \frac{417}{400}.
\]
Conclusion:
The value of \( \sin \theta \cos \theta + \tan^2 \theta \) is \( \frac{417}{400} \).