Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1)reads from a text file and makes an alphabetical list of all the words in that

ID: 3623714 • Letter: 1

Question

1)reads from a text file and makes an alphabetical list of all the words in that file. the list of words(string) is the output to another file.
2)assume no more than 50 words in the inpuut file : there may be less than 50 words in the file however, the max is 50. assume repetation of words meaning that some words may appear more than once in the input file in addition, assume that words will appear in mixed case(lower n upper) in the file
3)words are converted to lower case and inserted into a list in alphabetial order without repitation so, insert the string into the array of strings, unless it already appears there. the string in the array are kept in alpha order at all times.
4)an alpah order list all the words that were found without repitation, is written in an output file ,with one word per line
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Lab2Part2
{
String Wordlist; // The word (in lower case letters).
int count = 1; // The number of times the word has been found.
boolean found;

public static void main(String[] args) throws IOException
{
int[] x = new int[50];
for (int index = 0; index < args.length; index++)
System.out.println(args[index]);


File file = new File("Wordlist.txt");
Scanner inputFile = new Scanner(file);
PrintWriter outputFile = new PrintWriter("xyz.txt");

ArrayList<String> namelist = new ArrayList<String>();
//ArrayList<int> countlist = new ArrayList<int>();
//String namelist = "Wordlist.txt";
//String lower = namelist.toLowerCase();

namelist.add(Wordlist);
//namelist.add(Item 2);

/**if (namelist.contains("Item 1"))
{
System.out.println("true");
}
else
{
System.out.println("false");
}*/

while (inputFile.hasNext())
{
String Wordlist = inputFile.nextLine();
System.out.println(namelist);
}
//return valid;
inputFile.close();

/**if ()
{
nameList.contains(NewWord);

}
}*/
}
}

Explanation / Answer

Dear, Here is the code import java.io.*; import java.util.Arrays; import java.util.Scanner; import java.util.ArrayList; import java.util.List; public class Lab2Part2 { static String Wordlist[]; // The word (in lower case letters). static String Word; static int count = 0; // The number of times the word has been found. static boolean found; public static void main(String[] args) throws IOException { int[] x = new int[50]; for (int index = 0; index