*******PLEASE DO NOT COPY AND PASTE THIS PROGRAM, PLEASE MAKE IT ORIGINAL*******
THIS PROGRAM IS TO BE COMPLETED IN JAVA
Here is the answer for your question in Java Programming Language. NOTE : Since it is mentioned in the question to read a sentence, I kept the sample single line sentence given in question in 'input.txt' file.  CODE :  import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class WordCount {              public static void main(String[] args) throws IOException{                 //Let the input file name be 'input.txt' (Read the file name from the user if you want to read from another file)         String fileName = "input.txt";                  //File object and scanner objects         File file = new File(fileName);         Scanner reader = new Scanner(file);                  //Assuming only one line in the text file         //Reading the text and storing it in the 'line' variable         String line = reader.nextLine();         //Splitting the line to words         String[] words = line.split(" |\\.");                  //Close the reader object         reader.close();;         //Array to hold appearance counts         int[] appearanceCount = new int[words.length];                  //Calling UniqueWords Methods to store all unique words of line in an arra         String[] uniqueWords = UniqueWords(words);                  //Calling AppearanceCount method to get appearance count of each word uniqueWords.         appearanceCount = AppearanceCount(uniqueWords,words);                  //Sorting the arrays in alpbhabetical order         SortArrays(uniqueWords,appearanceCount);                  //Writing output to a file         PrintArrays(uniqueWords,appearanceCount);                       }          //Implementation of UniqueWords     public static String[] UniqueWords(String[] words){                 //Create an array to store unique words         String[] uniqueWords = new String[words.length];         //Flag to check whether the word is already exists or not         boolean flag;         int k = 0;         //Loop through each word in 'words'         for(String word : words){             flag = false;             //Loop length of uniqueWords times             for(int i = 0;i<k;i++){                 //If the word is already exists                 if(uniqueWords[i].equalsIgnoreCase(word)){                    flag = true;                 }             }             //If flag is still false             if(flag == false){                 //Add the word to array                 uniqueWords[k] = word;                 //Increment k by 1                 k++;             }                     }         String[] resizedUniqueWords = new String[k];         for(int i =0;i<k;i++)             resizedUniqueWords[i] = uniqueWords[i];         //Return uniqueWords array         return resizedUniqueWords;     }    ... See the full answer