Actors vs. components

The more I dig into this problem, the more confused I get.
Can anyone show the C++ code that gives the same functionality as this blueprint:

Where Mesh and Height are variables in the blueprint that are visible for editing.