Answer
See below.
Work Step by Step
Let $x$ be the number of minutes spent running ($0\leq x\leq60$). Then the number of minutes spent walking is: $60-x$. Then the amount of calories burnt if we run $x$ minutes is: $f(x)=x\cdot10+(60-x)\cdot4=10x+240-4x=240+6x$.
Thus if we walk $20$ minutes and then run $40$, the number of burnt calories is: $f(40)=240+6\cdot40=240+240=480$