/* * MyString.java * * Created: February 14, 2005 * By: Stan Sclaroff * Description: String class with methods wordCount and wordFrequency * For CS111 Spring 05 Programming Assignment 3 * * Modified: * By: * Description of changes: * */ package program3; /** * * @author Stan */ public class MyString { public MyString() { // Constructor -- do nothing. } // THE METHODS YOU WRITE // This method counts the words in the String line // words are separated by characters that are not letters or digits public int wordCount(String line){ int count = 0; return count; } // This method counts the number of times the word appears in the string line // The method looks for the exact occurence of the word. // The method ignores any characters that are not digits or letters // in matching word in the string line. public int wordFrequency(String word, String line){ int count = 0; // Be sure to handle the error cases here. return count; } }