Question: 1. A student wants an algorithm to find the hardest spelling word in a list of vocabulary. They define hardest by the longest word. Write

1. A student wants an algorithm to find the hardest spelling word in a list of vocabulary. They define hardest by the longest word.

Write the code to find the longest word stored in an array of Strings called list. If several words have the same length it should print the first word in list with the longest length.

For example, if the following list were declared:

String list [] = {"high", "every", "nearing", "checking", "food ", "stand", "value", "best", "energy", "add", "grand", "notation", "abducted", "food ", "stand"};

It would print:

checking

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!