Word

Complete a class named Word which is similar to this example and that includes a String as its only property. And, add appropriate constructors and the following methods to the Word class:

String getWord() - an accessor method that returns the String property of the Word object

String getFirstLetter() - returns the first letter of the Word object.

String getLastLetter() - returns the last letter of the Word object.

void removeFirstLetter() - permanently removes the first letter of the Word object.

void removeLastLetter() - permanently removes the last letter of the Word object.

int findLetter(String stringToFind)
- the position of the first occurrence of the String stringToFind is returned if it is present in the Word object. Otherwise, the method returns the value -1.

Complete this client class named WordTest that constructs a Word object with a word inputted by the user. In this client class, use Scanner to get the user's input for the word and the letter to find using findLetter. The client program must use each method from the Word class and display annotated output so that the instructor can easily tell that the methods work properly.

Your program must follow the class Coding Standards. Save all of the files in the appropriate network folder.

Preconditions:

    • A Word object is one word with three or more letters when each of the methods above are invoked.

You must hand in the following on separate pages stapled in this specified order:

    1. The source code for the Word class.
    2. The source code for the WordTest class.
    3. The printscreen of your console window output.