Question: Write a program in Java which accepts an input text file containing words, sorts them according to the first letter and outputs to the standard
Write a program in Java which accepts an input text file containing words, sorts them according to the first letter and outputs to the standard output. In order to sort, you must use the Insertion Sort (no other type of sorting is permitted for this assignment). It is assumed that words in the input text file are separated by commas. The name of the Java class must be StringSorter which implements the interface Sorter. The program must throw a RuntimeException if a word does not start with a letter, displaying the following message: Word found which does not start with a letter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
