Question: Write a program that loads the given dictionary into an ArrayList. Afterwards, ask the user for a word. Display the position in the list where

Write a program that loads the given dictionary into an ArrayList. Afterwards, ask the user for a word. Display the position in the list where the word occurs. I wasn't able to insert the dictionary file but i'm sure any dictionary file will work for this.

1st Test Case:

Standard Input:

hello

no

Required Output:

21882 words were loaded.

What word are you looking for?

"hello" is at index 8897

Search again?

2nd Test Case:

Standard Input:

hello

yes

world

yes

zip code

no

Required output:

21882 words were loaded.

What word are you looking for?

"hello" is at index 8897

Search again?

What word are you looking for?

"world" is at index 21688

Search again?

What word are you looking for?

"zip code" is at index -1

Search again?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!