Scrabble Help: The file dictionary.txt contains all of the words in the Official Scrabble Player's Dictionary, Second Edition. Note: this list contains some offensive language. Write a class, WordLists, in Java that generates useful word lists for scrabble players using this list. Your class should contain the following methods: WordLists(String fileName): a constructor that takes the name of the dictionary file as the only parameter. lengthN(int n): returns an ArrayList of all length n words (Strings) in the dictionary file. endsWith(char lastLetter, int n): returns an ArrayList of words of length n ending with the letter lastLetter containsLetter(char included, int index, int n): returns an ArrayList of words of length n containing the letter included at position index. So for example the word "cannon" would be on the list returned by containsLetter('o',6,4) because it contains the letter 'o', at index 4, and is length 6. multiLetter(int m, char included): returns an ArrayList of words with at least m occurrences of the letter included.   Use the included template for your WordLists.java file. Write your own test class, WordTest.java for your WordLists class that tries these methods out and writes the word lists (the ArrayLists of strings) to text files. What to hand in: A Template for the WordLists.java file is in the Programming Project 5 workspace on Codio. You must write your own test class called WordTest.java (separate file with main method) that tests each of your methods and writes the results to a text file. In addition to the source files include a text file named readMe.txt with an explanation of how your program works. That is, write in plain English, instructions for using your software, explanations for how and why you chose to design your code the way you did. The readMe.txt file is also an opportunity for you to get partial credit when certain requirements of the assignment are

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Scrabble Help: The file dictionary.txt contains all of the words in the Official Scrabble Player's Dictionary, Second Edition. Note: this list contains some offensive language. Write a class, WordLists, in Java that generates useful word lists for scrabble players using this list.

Your class should contain the following methods:

  • WordLists(String fileName): a constructor that takes the name of the dictionary file as the only parameter.
  • lengthN(int n): returns an ArrayList of all length n words (Strings) in the dictionary file.
  • endsWith(char lastLetter, int n): returns an ArrayList of words of length n ending with the letter lastLetter
  • containsLetter(char included, int index, int n): returns an ArrayList of words of length n containing the letter included at position index. So for example the word "cannon" would be on the list returned by containsLetter('o',6,4) because it contains the letter 'o', at index 4, and is length 6.
  • multiLetter(int m, char included): returns an ArrayList of words with at least m occurrences of the letter included.

 

Use the included template for your WordLists.java file. Write your own test class, WordTest.java for your WordLists class that tries these methods out and writes the word lists (the ArrayLists of strings) to text files.

What to hand in:

A Template for the WordLists.java file is in the Programming Project 5 workspace on Codio. You must write your own test class called WordTest.java (separate file with main method) that tests each of your methods and writes the results to a text file. In addition to the source files include a text file named readMe.txt with an explanation of how your program works. That is, write in plain English, instructions for using your software, explanations for how and why you chose to design your code the way you did. The readMe.txt file is also an opportunity for you to get partial credit when certain requirements of the assignment are not met.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education