Just looking at this code I can tell it wont compile.
Could someone please explain to me how to use the return statment, or link me to a site that does?
As for the "how to"... that's exactly how it works, there isn't anything else to it.
You have the return keyword, followed by an arbitrary expression. The function call evaluates to the returned value, so cubeOf(3.0) is equal to 27.0.