Step 1: Use Joule’s heating law.
Thermal energy produced in a resistor is:
\[
H = I^2 R t
\]
Step 2: Substitute given values.
\[
I = 5 \, A,\quad R = 10 \, \Omega,\quad t = 40 \, s
\]
Step 3: Compute step by step.
\[
H = (5)^2 \times 10 \times 40
\]
\[
H = 25 \times 10 \times 40
\]
\[
H = 250 \times 40 = 10000 \, J
\]
Step 4: Convert into kJ.
\[
10000 \, J = 10 \, kJ
\]
Step 5: Final interpretation.
Electrical energy fully converts into heat energy in the resistor.
\[
\boxed{10 \, kJ}
\]