Please design a Python application that has an array of 20 integers. Use the Random( ) function to populate this array.  You may use random.randint().  Print out the array after fully populating it. You should use positive integers <100. The application must ask the user to  enter an integer value (Print out the value that the user chose.) and then check whether that value is one of the elements in the array. Three searches must be done: two sequential(one on the unsorted array and one on the sorted array) and one binary.  Print the array before each search. Develop separate sequential and binary search modules, both of which must keep a count of the number of comparisons it makes until it finds the value or determines that it is not in the array. Each module should report out whether or not the value has been found along with the number of comparisons made.  Develop a sort module. Develop a separate report module that prints the array and the output statement. You must have a main() function that populates the array, requests user input (you may have a separate module for this if you would like), prints or calls a module to print the initial array and calls search and report modules. e.g.  The value  (print value here) was found in (#comparisons) or The value was not found in (# comparisons). The application should be done in Python. Include but comment out the code you used to test your code.  (You must do some testing.) Use your module names and variables names to make things clear.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Please design a Python application that has an array of 20 integers. Use the Random( ) function to populate this array.  You may use random.randint().  Print out the array after fully populating it. You should use positive integers <100.

The application must ask the user to  enter an integer value (Print out the value that the user chose.) and then check whether that value is one of the elements in the array. Three searches must be done: two sequential(one on the unsorted array and one on the sorted array) and one binary.  Print the array before each search.

Develop separate sequential and binary search modules, both of which must keep a count of the number of comparisons it makes until it finds the value or determines that it is not in the array. Each module should report out whether or not the value has been found along with the number of comparisons made. 

Develop a sort module.

Develop a separate report module that prints the array and the output statement.

You must have a main() function that populates the array, requests user input (you may have a separate module for this if you would like), prints or calls a module to print the initial array and calls search and report modules.

e.g.  The value  (print value here) was found in (#comparisons) or The value was not found in (# comparisons).

The application should be done in Python.

Include but comment out the code you used to test your code.  (You must do some testing.)

Use your module names and variables names to make things clear.

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,