@@ -0,0 +1,417 @@
+// http://codingbat.com/prob/p111624%0A%0Apublic boolean catDog(String str) %7B%0A  int numberOfCatInstances = 0;%0A  int numberOfDogInstances = 0;%0A  for (int i = 0; i %3C str.length()-2; ++i) %7B%0A    if (str.substring(i, i+3).equals(%22cat%22)) %7B%0A      numberOfCatInstances++;%0A    %7D%0A    else if (str.substring(i, i+3).equals(%22dog%22)) %7B%0A      numberOfDogInstances++;%0A    %7D%0A  %7D%0A  return (numberOfCatInstances == numberOfDogInstances);%0A%7D%0A

Create catDog.java