Write a program, “NameSort”. The program will create an array of
type String that holds 10 names.
The names are: Chloe, Sabrina, James, Ralph, Malcom, Agnes,
Heidi, Clarence, Rhonda, and Lorenzo.
PUT THE NAMES IN THE ARRAY IN THE ORDER GIVEN. THE ARRAY
THEN MUST BE SORTED.
Use the title “The list before being sorted”. Print the list in
a 2 rows by 5 columns format.
Then sort the list in alphabetical order, using a selection
sort.
Print the new list using the title, “The list after being
sorted” in the same format as the unsorted list.
After the list of names is sorted search for the name “Ralph”.
Replace “Ralph” with “Rafael” then print the list again Using the
title
"Ralph has been replaced by Rafael".
Java
Write a program, “NameSort”. The program will create an array of type String that holds 10 names. The names are: Chloe,
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am