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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started