A company has 600 employees whose names are currently stored using a collectioncalled NAMES. The names are stored as surname, first name. For example: Smith, Jane,Uysal, Rafael, Ahmed, Ishmael, Jonsonn, Sara, …(a) Construct a pseudocode algorithm that will store the surnames in one array andfirst names in another.
Question
A company has 600 employees whose names are currently stored using a collectioncalled NAMES. The names are stored as surname, first name. For example: Smith, Jane,Uysal, Rafael, Ahmed, Ishmael, Jonsonn, Sara, …(a) Construct a pseudocode algorithm that will store the surnames in one array andfirst names in another.
Solution
Sure, here is a pseudocode algorithm that will store the surnames in one array and first names in another:
Initialize an empty array called SURNAMES
Initialize an empty array called FIRSTNAMES
For each name in NAMES collection
Split the name by comma into two parts: surname and first name
Add the surname to the SURNAMES array
Add the first name to the FIRSTNAMES array
End For
This pseudocode assumes that the names are stored as "Surname, Firstname" and that there is a comma and a space between the surname and the first name. The "Split" function is used to separate the surname and the first name. The surname (the first part) is added to the SURNAMES array, and the first name (the second part) is added to the FIRSTNAMES array. This is done for each name in the NAMES collection.
Similar Questions
Use a UNION to create a list of all the employee's and customer's first names and last names ordered by the last name in descending order.
The names of each employee in a database would most likely be stored where?In rowsIn every field In columnsAs separate tables
write an algorithm in pseudocode, to print 50 names and 50 ID-numbers that have been stored in an 2D array
Consider a scenario where you need to manage records of employees in a company. Create aprogram in C that utilizes structures to handle employee information. The program shouldperform the following tasks:a. Define a structure named Employee with the following attributes:Employee ID (integer)Employee Name (string)Department (string)Salary (float)b. Create an array of structures to store information for a maximum of 5 employees.c. Display the information of the employees.
Complete the program below. It should:define a function thatasks the user for their first nameasks the user for their last namereturns "x y", where x is their first name and y is their last nameoutputs the result of the function
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.