Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAMMING (60 points) Scrabble Help: The file dictionary.txtPreview the document contains all of the words in the Official Scrabble Player's Dictionary, Second Edition. (Note this

PROGRAMMING (60 points) Scrabble Help: The file dictionary.txtPreview the document 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. startsWith(char firstLetter, int n): returns an ArrayList of words of length n beginning with the letter firstLetter containsLetter(char included, int n): returns an ArrayList of words of length n containing the letter included but not beginning with it. multiLetter(char included, int m): returns an ArrayList of words with at least m occurrences of the letter included. Use the included template for your WordLists.javaPreview the document file. Write your own test class for your WordLists class that tries these methods out and writes the word lists (the ArrayLists of strings) to text files.

A Template for the WordLists.java file is in the Assignment. You must create your own test class (separate file with main method) that tests each of your methods and writes the resutls 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.

Template:

//************************************* // // WordLists.java // // Class to aid with Scrabble // Programming Project 5, COMS W1004 // // // Your Name:jia yan // Your Uni: //**************************************

import java.util.ArrayList;

public class WordLists{ //instance variables private String[] words; //array of words taken in private int wordCount; private File name; private Boolean hasLetter;

public WordLists(String fileName){

// your code here

}

public ArrayList lengthN(int n){ // your code here }

public ArrayList startsWith(char firstLetter, int n){

// your code here

}

public ArrayList containsLetter(char included, int n){

// your code here

}

public ArrayList multiLetter(char included, int m){

// your code here

}

} // end of class

Part of the dictionary,its a lot:

aa aah aahed aahing aahs aal aalii aaliis aals aardvark aardvarks aardwolf aardwolves aargh aas aasvogel aasvogels aba abaca abacas abaci aback abacus abacuses abaft abaka abakas abalone abalones abamp abampere abamperes abamps abandon abandoned abandoning abandonment abandonments abandons abas abase abased abasedly abasement abasements abaser abasers abases abash abashed abashes abashing abashment abashments abasing abatable abate abated abatement abatements abater abaters abates abating abatis abatises abator abators abattis abattises abattoir abattoirs abaxial abaxile abba abbacies abbacy abbas abbatial abbe abbes abbess abbesses abbey abbeys abbot abbotcies abbotcy abbots abbreviate abbreviated abbreviates abbreviating abbreviation abbreviations abbreviator abbreviators abdicate abdicated abdicates abdicating abdication abdications abdicator abdicators abdomen abdomens abdomina abdominal abdominally abduce abduced abducens abducent abducentes abduces abducing abduct abducted abducting abduction abductions abductor abductores abductors abducts abeam abed abele abeles abelmosk abelmosks aberrance aberrances aberrancies aberrancy aberrant aberrants aberration aberrational aberrations abet abetment abetments abets abettal abettals abetted abetter abetters abetting abettor abettors abeyance abeyances abeyancies abeyancy abeyant abfarad abfarads abhenries abhenry abhenrys abhor abhorred abhorrence abhorrent abhorrently abhorrer abhorrers abhorring abhors abidance abidances abide abided abider abiders abides abiding abigail abigails abilities ability abioses abiosis abiotic abject abjectly abjectness abjuration abjurations abjure abjured abjurer abjurers abjures abjuring ablate ablated ablates ablating ablation ablations ablative ablatives ablaut ablauts ablaze able ablegate ablegates abler ables ablest ablings ablins abloom abluent abluents ablush abluted ablution ablutions ably abmho abmhos abnegate abnegated abnegates abnegating abnegation abnegations abnegator abnegators abnormal abnormalities abnormality abnormally abnormals abo aboard abode aboded abodes aboding abohm abohms aboideau aboideaus aboideaux aboil aboiteau aboiteaus aboiteaux abolish abolished abolishes abolishing abolishment abolishments abolition abolitionary abolitionism abolitionist abolitionists abolitions abolla abollae aboma abomas abomasa abomasal abomasi abomasum abomasus abominable abominably abominate abominated abominates abominating abomination abominations abominator abominators aboon aboral aborally aboriginal aboriginally aborigine aborigines aborning abort aborted aborter aborters aborting abortion abortionist abortionists abortions abortive abortively aborts abos abought aboulia aboulias aboulic abound abounded abounding abounds about above aboveboard aboves abracadabra abradant abradants abrade abraded abrader abraders abrades abrading abrasion abrasions abrasive abrasives abreact abreacted abreacting abreacts abreast abri abridge abridged abridgement abridgements abridger abridgers abridges abridging abridgment abridgments abris abroach abroad abrogate abrogated abrogates abrogating abrogation abrogations abrupt abrupter abruptest abruptly abruptness abscess abscessed abscesses abscessing abscise abscised abscises abscisin abscising abscisins abscissa abscissae abscissas abscission abscissions abscond absconded absconding absconds absence absences absent absented absentee absenteeism absentees absenter absenters absenting absently absentminded absentmindedly absentmindedness absents absinth absinthe absinthes absinths absolute absolutely absoluteness absoluter absolutes absolutest absolution absolutions absolutism absolutist absolutistic absolutists absolve absolved absolver absolvers absolves absolving absonant absorb absorbabilities absorbability absorbable absorbed absorbencies absorbency absorbent absorber absorbers absorbing absorbingly absorbs absorption absorptions absorptive abstain abstained abstainer abstainers abstaining abstains abstemious abstemiously abstention abstentions abstentious absterge absterged absterges absterging abstinence abstinent abstract abstracted abstractedly abstracter abstracters abstractest abstracting abstraction abstractions abstractive abstractly abstractness abstractor abstractors abstracts abstrict abstricted abstricting abstricts abstruse abstrusely abstruseness abstruser abstrusest absurd absurder absurdest absurdities absurdity absurdly absurdness absurds abubble abulia abulias abulic abundance abundances abundant abundantly abusable abuse abused abuser abusers abuses abusing abusive abusively abusiveness abut abutilon abutilons abutment abutments abuts abuttal abuttals abutted abutter abutters abutting abuzz abvolt abvolts abwatt abwatts aby abye abyes abying abys abysm abysmal abysmally abysms abyss abyssal abysses acacia acacias academe academes academia academias academic academically academician academicians academicism academics academies academy acajou acajous acaleph acalephae acalephe acalephes acalephs acanthi acanthus acanthuses acari acarid acaridan acaridans acarids acarine acarines acaroid acarpous acarus acaudal acaudate acauline acaulose acaulous accede acceded acceder acceders accedes acceding accelerando accelerate accelerated accelerates accelerating acceleration accelerations accelerative accelerator accelerators accelerometer accelerometers accent accented accenting accentor accentors accents accentual accentuate accentuated accentuates accentuating accentuation accentuations accept acceptabilities acceptability acceptable acceptably acceptance acceptances acceptant acceptation acceptations accepted acceptee acceptees accepter accepters accepting acceptor acceptors accepts access accessaries accessary accessed accesses accessibilities accessibility accessible accessibleness accessibly accessing accession accessional accessions accessories accessory accident accidental accidentally accidentalness accidently accidents accidie accidies acclaim acclaimed acclaiming acclaims acclamation acclamations acclimate acclimated acclimates acclimating acclimation acclimations acclimatization acclimatizations acclimatize acclimatized acclimatizes acclimatizing acclivities acclivity accolade accolades accommodate accommodated accommodates accommodating accommodatingly accommodation accommodations accommodative accompanied accompanies accompaniment accompaniments accompanist accompanists accompany accompanying accomplice accomplices accomplish accomplished accomplisher accomplishers accomplishes accomplishing accomplishment accomplishments accord accordance accordances accordant accordantly accorded accorder accorders according accordingly accordion accordionist accordionists accordions accords accost accosted accosting accosts account accountabilities accountability accountable accountably accountancy accountant accountants accounted accounting accountings accounts accouter accoutered accoutering accouterment accouterments accouters accoutre accoutred accoutrement accoutrements accoutres accoutring accredit accreditation accreditations accredited accrediting accredits accrete accreted accretes accreting accretion accretionary accretions accrual accruals accrue accrued accruement accruements accrues accruing acculturate acculturated acculturates acculturating acculturation acculturations accumulate accumulated accumulates accumulating accumulation accumulations accumulative accumulator accumulators accuracies accuracy accurate accurately accurateness accursed accurst accusal accusals accusant accusants

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago

Question

Describe the linkages between HRM and strategy formulation. page 74

Answered: 1 week ago

Question

Identify approaches to improving retention rates.

Answered: 1 week ago