We’ll now build a complete Math Quiz App step by step, using functions to make our code cleaner and reusable. Each step adds one requirement and builds on top of the previous code.

Step 1: Ask the user for their name

Start by writing a function getUserName() that asks for the user’s name and returns it. This makes our code modular and reusable.

Get hands-on with 1400+ tech skills courses.