The thermal efficiency \( \eta \) of the heat engine is given as:
\[
\eta = 0.40
\]
The second-law efficiency \( \eta_{{II}} \) is the ratio of the actual efficiency to the maximum possible efficiency, which is the Carnot efficiency. The Carnot efficiency \( \eta_{{Carnot}} \) is given by:
\[
\eta_{{Carnot}} = 1 - \frac{T_L}{T_H}
\]
where \( T_H = 600 \, {K} \) is the temperature of the heat source and \( T_L = 300 \, {K} \) is the temperature of the heat sink.
Substituting the values:
\[
\eta_{{Carnot}} = 1 - \frac{300}{600} = 1 - 0.5 = 0.5
\]
Now, the second-law efficiency is:
\[
\eta_{{II}} = \frac{\eta}{\eta_{{Carnot}}} = \frac{0.40}{0.50} = 0.80
\]
Thus, the second-law efficiency of the engine is \( 80% \).