This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] Following the official treatment: $W=\int_0^4x^2y\,dx+\int_0^2y^2\,dy$ with $y=10-x$ in the first term. $\int_0^4x^2(10-x)\,dx=\frac{640}3-64=\frac{448}3$ and $\int_0^2y^2\,dy=\frac83$. $W=\frac{448+8}3=152$ J. (Medium confidence: the end point $(4,2)$ does not lie on $x+y=10$, so the problem is loosely posed; this follows the key.) Answer: 152.