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:20
Write a program called assignment3 (saved in a file assignment3.java) that computes the greatest common divisor of two given integers. one of the oldest numerical algorithms was described by the greek mathematician, euclid, in 300 b.c. it is a simple but very e↵ective algorithm that computes the greatest common divisor of two given integers. for instance, given integers 24 and 18, the greatest common divisor is 6, because 6 is the largest integer that divides evenly into both 24 and 18. we will denote the greatest common divisor of x and y as gcd(x, y). the algorithm is based on the clever idea that the gcd(x, y) = gcd(x ! y, y) if x > = y and gcd(x, y) = gcd(x, y ! x) if x < y. the algorithm consists of a series of steps (loop iterations) where the “larger” integer is replaced by the di↵erence of the larger and smaller integer. this continues until the two values are equal. that is then the gcd.
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
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, 13.10.2020 15:01
question
Mathematics, 13.10.2020 15:01
question
Mathematics, 13.10.2020 15:01
Questions on the website: 13722367