import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class LoadDictionary { public static void main(String[] args) throws Exception { String[] dictionary = new String[45402]; dictionary = buildDictionary(); //builds an Array of English words using a dictionary text file outputWords(dictionary); //output the words that remain in the dictionary Array - these are potential solutions } public static String[] buildDictionary() { String[] wordList = new String[45402]; File f = new File("dictionary.txt"); Scanner input = null; int x =0; try //try...catch is used when the possibility of an error could result and we want to catch it without causing a runtime error { input = new Scanner(f); //Scanner is build based on input from the text, not the console } catch (FileNotFoundException e) { System.out.println("dictionary.txt file not found"); e.printStackTrace(); } while (input.hasNext()) { String word = input.nextLine(); //one word appears on each line in the text file wordList[x] = word; //add each word into the wordList Array x++; } input.close(); System.out.println(wordList.length + " words loaded."); //outputs the size of the Array built return wordList; } public static void outputWords(String[] words) { for (int x =0; x < words.length; x++) { System.out.println(words[x]); } } public static boolean isPalindrome(String st) { st = st.toUpperCase(); for (int x =0; x < st.length(); x++) { if (st.charAt(x)!=st.charAt(st.length()-1-x)) return false; } return true; } public static boolean isVowel(char c) { return c=='A' || c == 'E' || c=='I' || c=='O' || c=='U'; } public static boolean isConsonant(char c) { return !isVowel(c); } public static boolean isInDictionary(String st, String[] dictionary) { //might be helpful...you create it return true; } }