exercise 3 of  basic ruby