Computers and Technology

Programming Exercise #2 : Design a program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. Programming Exercise #4 : Modify the Sorted Names program that you wrote for exercise #2 so it allows you to search the array for a specific name.

Design a modular (no global variables or constants) program to solve Chapter 9 Programming Exercise 2 (Sorted Names) combined with Chapter 9 Programming Exercise 4 (Name Search) in your textbook with the following additional program requirements:
• Program functionality for the main module should execute as follows:
o Create an array of 10 names initially populated with values. The pseudocode format for this array is given below:

Declare String names[10] = “Ross Harrison”, “Hannah Beauregard”, “Bob White”, “Ava Fischer”, “Chris Rich”, “Xavier Adams”, “Sasha Ricci”, “Danielle Porter”, “Gordon Pike”, “Matt Hoyle”
o Sort the array of 10 names in ascending (a to z) order using either the Bubble, Selection, or Insertion Sort algorithms. Sort the names by first and last name together (NOTE: Do not parse out the last name and sort by last name. For example, ‘Ava Fischer’ is before ‘Xavier Adams’.) o Display the sorted list of names to the user with a descriptive message.
o Prompt the user to enter a name to search and use the search name to determine if it is in the array of names.
o If the name is found in the list, identify the ordered number (in the array) of the user requested name. If the name is not found in the list, display an error message indicating the name is not in the list.
• Include and use modules (at least) to do the following: o Main controlling start module to create variables, call sort and display modules, prompt for search name, call search function and display search results
o Sort names array.
o Display the names array

• Include and use a function (at least) to do the following: o Search the names array for a given name (passed as a parameter) and return the index of found, -1 otherwise. No display output is done in this function. Use either the Linear Search or the Binary Search algorithms in your solution.

• Include a modular approach: no global variables, use parameters and return values to transfer data between modules and functions.

(a) Create the properly aligned textbook format pseudocode
(b) Create the Python source code (SearchNames. py) that represents the pseudocode requirements from the previous step.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, lailahussain99
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
image
Computers and Technology, 23.06.2019 18:30, sawyerfauver
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, bevanscory123
What are loans to a company or government for a set amount of time
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, boo3972
Match the file formats with the types of multimedia they can store
Answers: 2
Do you know the correct answer?
Programming Exercise #2 : Design a program that allows the user to enter 20 names into a String arra...

Questions in other subjects:

Konu
Mathematics, 27.11.2019 20:31