// Q6
public class ArrayOfStrings {

	public static void main(String[] args) {
		String[] story = { "This is a little story about four people named ",
		                   "Everybody, Somebody, Anybody and Nobody.",
		                   "There was an important job to be done and ",
		                   "Everybody was sure that Somebody would do it." };
		/*
		String[] story = { "This is a little story about four people named ",
		                   "Everybody, Somebody, Anybody and Nobody.",
		                   "There was an important job to be done and ",
		                   "Everybody was sure that Somebody would do it.",
		                   "Anybody could have done it, but Nobody did it. ",
		                   "Somebody got angry about that because it was Everybody's job.",
		                   "Everybody thought that Anybody could do it, ",
		                   "but Nobody realized that Everybody wouldn't do it.",
		                   "It ended up that Everybody blamed Somebody ",
		                   "when Nobody did what Anybody could have done." };
    */

		int count = 0;
		System.out.println("story.length = " + story.length);
		for (int i=0; i<story.length; i++) {
			if ((story[i].indexOf("body") > -1) &&
				(story[i].indexOf("body") 
				 == story[i].lastIndexOf("body"))) {
				System.out.println("At " + i);
				count++;
			}
		}
		System.out.println(count);
	}

}

