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, 22.06.2019 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
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, 13.01.2020 02:31
Questions on the website: 13722367