You missed the part where a value is passed in, processed, and returned.
Don't just hand him complete working code. He made no attempt to write any
code himself, and he won't learn anything until he does, and it's
obviously homework, the first assignment of the semester by the look of it.