subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
How are we able to create photographs differently than 100 years ago? explain your answer in relation to your photograph you selected.
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
You know the right answer?
Programming Exercise #2 : Design a program that allows the user to enter 20 names into a String arra...
Questions
question
Mathematics, 15.07.2020 03:01
Questions on the website: 13722361