Hi JayPea,
In that exercise, they just wanted to teach, how we can develop logic using an If, switch and how we can implement ad -hoc loop.
You can opt client action and call it in your screen Factorial action. So, Instead of choosing server action, you can make client action to calculate factorial.
Thank you
,