Need to create a user based input file
<p>I am a student trying to finish a lab assignment.<br/> I have two files, <code>Sentence.java</code> and <code>Sentence.Tester.java</code> but I'm confused about filling in the public <code>String findWord()</code> method and <code>public String insertSecondWord()</code> though I could have done both files completely wrong. <br/>
The <strong>findWord</strong> method is supposed to returns the index location of a given word in the sentence, but wouldn't that be based on user input(Also the insertSecondWord() uses input) depends on the ?<br/><br> However the teacher said the scanner method is only in the tester and only use string methods in the sentence. Could someone please explain how edit the <code>findWord()</code> and <code>insertSecondWord()</code> methods so they work correctly?</p>

<p>Thanks :)</p>

<p><strong>Edit 1</strong>: Put in the new code for the two methods I am having problems with but now I am getting 7 errors</p>

<p><strong>error:</strong> cannot find symbol on 45, 67, 76, and 85 as well as two errors on 56 as well as an error missing method body or declare abstract.</p>

<p>(These could be simply errors that I am not catching but I have worked on this and another lab all day and am java brain dead). </p>

<pre><code>/**
 *A Sentence provides information about the contents of a sentence.
 */
 public class Sentence
{
    // instance field (only one!)
    private String phrase;


    /**
     * Constructs a Sentence object with a given String
     * @param phrase the selected phrase
     */
    public Sentence(String sentence)
    {
        phrase = sentence;
    }
    /**
     * Returns the number of characters in the sentence
     * @return the number of characters in the sentence
     */
     // add the remaining methods as described

    public int characterCount()

    {
        int count = phrase.length();
        return count;
    }
    /**
     * Returns the first word of the sentence
     * @return the first word
     */

    public String firstWord()

    {
        String first = phrase.substring(0, sentence.indexOf(" "));


    }
    /**
     * Returns the last word of the sentence
     * @return the the last word of the sentence
     */

    public String lastWord()
    {
        String last = phrase.substring(sentence.lastIndexOf(" "), sentence.length());
    }

    /**
     * find returns the index location of a given word in the sentence
     * @param the word being searched for
     * @return the index location
     */

    public int findWord(String word);
    {
        int find = indexOf(word);
    }
    /**
     * changes the sentence by inserting a given word after the existing first word
     * @param second the word being added
     */

    public void insertSecondWord(String second)
    {
        String replace = replace.phrase(" ",  second);
    }
    /**
     * returns the sentence
     * @return the sentence
     */

    public String getSentence()
    {
        return sentence;
    }


}

// The Scanner is ONLY in the tester, not Sentence. Use string methods in Sentence





import javax.swing.JOptionPane;

/**
 * A class to test the CoinCounter class
 */

public class CoinCounterTester
{
    /**
     * Tests methods of the CoinCounter class
     * @param args not used
     */
    public static void main(String[] args)
    {
        CoinCounter coinCounter = new CoinCounter(int quarters, int dimes, int nickels, int pennies);

        String penny = JOptionPane.showInputDialog("Enter the quantity of pennies");
        int pennies = Integer.parseInt(penny);

        String nickel = JOptionPane.showInputDialog("Enter the quantity of nickels");
        int nickels = Integer.parseInt(nickel);

        String dime = JOptionPane.showInputDialog("Enter the quantity of dimes");
        int dimes = Integer.parseInt(dime);

        String quarter = JOptionPane.showInputDialog("Enter the quantity of quarters");
        int quarters = Integer.parseInt(quarter);



        System.exit(0);
    }
}
</code></pre>
