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.
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.
Unlock instant AI solutions
Tap the button
to generate a solution