Question
/* Write a JAVA program to remove all strings of even length from a list of strings. Scan the name of a file from user
/*
Write a JAVA program to remove all strings of even length from a list of strings.
Scan the name of a file from user input containing the strings, and two
integers, n1 and n2, representing starting and ending indices (see below).
Read in the (LARGE) file containing the strings, and output the initial size of this list.
After removing all evens, output the final list size. Finally, output all odd words from index n1 to index n2.
Your program will need to be efficient to avoid timing out.
Input/output example:
Removes strings of even length from an array.
Enter filename for file containing strings: file1.txt
Enter two indices for range of odd words to be printed out:
151770
151775
initial list.size(): 327290
final list.size(): 151780
odd words from index 151770 to 151775:
ARE
NOT
DISTRIBUTED
COMMERCIALLY.
ANY
SERVICE
*/
Removes strings of even length from an array. Enter filename for file containing strings: HamletTitlePage.txt ENTER In Enter two indices for range of odd words to be printed out: 2 7 ENTER initial list.size(): 34 final list.size(): 18 odd words from index 2 to 7: Project cooperation in World Inc., their Library inStep 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