Have the function WordCount(str) take the str string parameter being passed and return the number of words the string contains (ie. "Never eat shredded wheat" would return 4). Words will be separated by single spaces.

Solution in Java
Solution in JavaScript
I am going to convert str to an Array breaking each word into an Array entry when there is a space. Then return the length of the Array which is the number of words in the string. Using the JavaScript language, have the function WordCount(str) take the str string parameter being passed and return the number of words the string contains (ie. "Never eat shredded wheat" would return 4). Words will be separated by single spaces.
Steps for solution
1) Convert string to an array breaking on space.
2) Return array length since this is the number of words
Using the Python language, have the function WordCount(str) take the str string parameter being passed and return the number of words the string contains (ie. "Never eat shredded wheat" would return 4). Words will be separated by single spaces.