for the greet method:

try using string interpolation, it's very useful

def greeter(name)
  return "Hello #{name}"
end

The interpolation allows you to call on a variable, you can also call
methods within the interpolation

For example, if you want to capitalize the name, you would change it to
#{name.capitalize}

When you are calling the greet method, a useful method to call on it (while
testing) is the inspect method which can be done by either:
p greeter(name) or greeter(name).inspect



for the number problem:

you are requesting a true or false state, evaluating i%3==0

i%3 == 0 will already produce a true or false statement

Therefore, all you have to write is

def by_three?(num)
  i % 3 == 0
end

This will give you either true or false
You do not have to do an if-else-if and "True!" or "False!"

When looking for a boolean value, all you need to do is write a conditional
equation


Good luck! You're doing good!

-Josh



On Fri, Sep 12, 2014 at 11:48 PM, Cyril Guirguis <
c.guirguis / mail.utoronto.ca> wrote:

> I'm a beginner and have started Ruby on codecademy.com.
>
>
> I was told to do something on codecademy which is giving me problems:
>
> Define two methods in the editor:
>
> A greeter method that takes a single string parameter, name, and returns a
> string greeting that person. (Make sure to use return and don't use print
> or puts.)
> A by_three? method that takes a single integer parameter, number, and
> returnstrue if that number is evenly divisible by three and false if not.
>
> This is what I did:
> def greeter(name)
>     return "Hey" + name
> end
>
> def by_three?(number)
>     if number % 3 == 0
>         return "true!"
>     else
>         return false
> end
>
> When I run it, it tells me there is a problem with the greeter method.
> I've tried multiple things, but nothing seems to work. I should say that
> the codecademy.com console expects you to code it exactly how they want
> it, else, it will return an error. Some other things I tried...
>
> def greeter(name)
>       return "Hey" + name
> end
>
> name("Phoebe")
>
> Thanks!
>
>