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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, sabrinarasull1pe6s61
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Answers: 2
image
Computers and Technology, 22.06.2019 06:30, Melissamv2052
Selective incapacitation is a strategy to reduce prison population
Answers: 3
image
Computers and Technology, 22.06.2019 16:30, mesposito
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
image
Computers and Technology, 22.06.2019 17:30, bl88676
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
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 in other subjects:

Konu
Mathematics, 05.11.2020 03:20