Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* 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

*/

image text in transcribed

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 in

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

Students also viewed these Databases questions