Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an entire program (partially complete-see Lab6.java) that sorts a list of words several different ways (3 below preceded with 2 other formats-see checked list

image text in transcribed

Write an entire program (partially complete-see Lab6.java) that sorts a list of words several different ways (3 below preceded with 2 other formats-see checked list below): 1. Alphabetically-case insensitive (has to be implemented as your own comparator, however, the comparator can implement the String class compare TolgnoreCase method) 2. Based on word length (longest words come first) and alphabetically descending for matching length 3. Based on a count of vowels found in the words, (highest vowel count come first) and alphabetically descending for matching vowel counts. Vowels are a, e, i, o, u Each of the above processes will be saved in separate comparator classes (as discussed in class) in the same folder as your driver program. The driver program should open the input (Swordfile.txt" on Canvas) and output ("Result.txt") files. It should then pass the Scanner and PrintStream objects to static methods which will: Insert the input words into an ArrayList Print this list of words (one word per line) to the output file Sort the words alphabetically, using the Collections sort without sending it a comparator and print them to the output file (one word per line). Sort the words alphabetically, case-insensitive (using your own comparator) and print them to the output file (one word per line). Sort the words by length in descending order (longest first) and alphabetically DESCENDING (case insensitive) when lengths match (using your own comparator). Print them to the output file (one word per line). Sort the words by number of vowels in descending order (greatest vowel count first) and then descending alphabetically (case insensitive) when vowel counts are equal (using your own comparator) & send to the output file (one word per line). Be SURE to insert a one line heading before each group described above to indicate which version of sorting is being applied. Also, BE SURE to check off each item in the above list so you don't forget one of the output formats. There should be 5 (YES FIVE that's F-I-V-E Five!) different lists! Pheew. Hope you get the message

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Public Finance

Authors: Harvey S. Rosen

5th Edition

025617329X, 978-0256173291

Students also viewed these Databases questions