Solved problem 3

created a string and split it into an array to find the number of words
in the string.