Question 2 Let say an Array consist of String names as follow: [i] [0] [1] [2] [3] [4] [5] [6] String John Martha Alex Cindy Roland Susan Didie (a) Write a code that can Search for array location (1) of "Roland" in the array Example output: Enter Name: Roland Searching... Result: The Name is at [4] (b) Write a code that can Sort the array in alphabetical order. Example output: Current Names in Arrays: John. Martha..... etc Sorting... Sorted Names: Alex......

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question
Question 2
Let say an Array consist of String names as follow:
[i]
String
[0]
John
Martha
Alex
Cindy
Roland
[1]
[2]
[3]
[4]
[5]
[6]
Susan
Didie
(a) Write a code that can Search for array location (1) of "Roland" in the array
Example output:
Enter Name: Roland
Searching...
Result: The Name is at [4]
(b) Write a code that can Sort the array in alphabetical order.
Example output:
Current Names in Arrays: John, Martha..... etc
Sorting...
Sorted Names : Alex......
Transcribed Image Text:Question 2 Let say an Array consist of String names as follow: [i] String [0] John Martha Alex Cindy Roland [1] [2] [3] [4] [5] [6] Susan Didie (a) Write a code that can Search for array location (1) of "Roland" in the array Example output: Enter Name: Roland Searching... Result: The Name is at [4] (b) Write a code that can Sort the array in alphabetical order. Example output: Current Names in Arrays: John, Martha..... etc Sorting... Sorted Names : Alex......
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT