195k views
4 votes
Drag each label to the correct location. Not all labels will be used.

complete the algorithm that accepts a list of names from a user and displays the longest name
1. Start.
2. Start to read the list of names name[]
3. Set name as "".
4. Set length as 0
5.
6. If you have reached the end of this list then go to step 12
7. If the length of the current name is greater than length, then go to step eight, else go step 10.
8. Set length as the length of the current name
9. Set name as the current name
10. Advance to the next name
11.
12. Display name
13. Stop


Drag each label to the correct location. Not all labels will be used. complete the-example-1

1 Answer

5 votes

Answer:

1. Start.

2. Start to read the list of names name[]

3. Set name as

4. Set length as O

5. For each name in the list:

6. If the length of the current name is greater than length, then go to step eight, else go step 10.

7. Set length as the length of the current name

8. Set name as the current name

9. Advance to the next name

10. End the loop

11. Display name

12. Stop.

User Cybertextron
by
8.0k points