Question: make a java application that will modify a list of words from a file called word.txt. The application will be menu driven. The menu will

make a java application that will modify a list of words from a file called word.txt. The application will be menu driven. The menu will look like the one below:

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 Quit

Clearly you need to create a class called Word. You need to use an ArrayList in your class to store each word from the file word.txt.

A) When option 1 is entered a method called loadWords() will load the words from file into the ArrayList and the number of words in the list will be displayed. The example is below.

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

1

Currently have 370103 words in memory

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 Quit

b) When option 2 is entered a method called upDateWords() will ask the user to enter the length of word to keep in the list. When the method is finished the list will contain only words of the specified length. The number of words in the new list will also be displayed. I/O example is below.

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

2

Prune Word List by Length

Which length words would you like to keep?

Currently have 41998 words in memory.

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 Quit

c) When option 3 is entered, a method called findPalindromes() will search the existing word list to find all palindromes. The palindromes will listed as well as a statement indicating the amount. The I/O example is below.

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

3

Palindromes found: 15

Here they are:

adinida

deedeed

deified

hagigah

halalah

murdrum

ottetto

peeweep

reifier

repaper

reviver

rotator

sememes

senones

sooloos

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

d) When option 4 is entered a method called pigLatin() will ask the user to enter an English word to be converted to Pig Latin. The rules for English to Pig Latin can be found athttps://en.wikipedia.org/wiki/Pig_Latin. Please use one the first three rules in you code . examples are below.

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

4

Type a word to translate to Pig Latin

ultimate

Word is now: ultimateay

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

4

Type a word to translate to Pig Latin

duck

Word is now: uckday

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

4

Type a word to translate to Pig Latin

yellow

Word is now: ellowyay

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

4

Type a word to translate to Pig Latin

pig

Word is now: igpay

Word Analysis

1 - Load/reload words from file

2 - Update word list

3 - Find palindromes

4 - Try Pig Latin

5 - Quit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!