Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Java. Prompt the user to enter a list of strings. This could be a list of names, cities, sports teams, etc. The user can

Use Java.

Prompt the user to enter a list of strings. This could be a list of names, cities, sports teams, etc. The user can enter the list of words in one list, or individually after pressing enter after each entry.

Parse the list of strings into an array. (There are two primary ways you can design this, either using a for loop, with the user entering one word at a time, or by splitting the entire list in one step.)

Prompt the user to enter the word to search for. (Example; Seattle, or Seahawks, or Canada, etc)

The program should search the array for the search word, and determine if the search word exists in the array. If the word exists more than once, it should produce a count of the number of times it exists.

The program will then output the list of words, the search word, whether the search word exists in the list (yes or no), and if it does exist, how many times it is found in the list.

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_2

Step: 3

blur-text-image_3

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

i need correct answrrs 1 1 2 . .

Answered: 1 week ago

Question

Complexity of linear search is O ( n ) . Your answer: True False

Answered: 1 week ago