Answer to Question #254902 in Algorithms for Israel

Question #254902
Algorithm for a program that allows the user to enter any number of names; i.e – last name and first name. Using one of the predefined methods of the Array class, order the names in ascending order. Display the results.
1
Expert's answer
2021-10-23T08:05:45-0400
Start
   Declare variable numberNames as integer
   Declare variable lastName as String
   Declare variable firstName as String
   Read numberNames
   Create array names[]
   for i = 0 to numberNames step i=i+1
       Read the firstName 
       Read the lastName
       Add lastName and firstName to the array names
   sort array names by lastName
   Display the names in ascending order.
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS