Question: Let us develop a C++ program with the following requirements. 1. The program first creates an array of 20 random positive numbers between 1 and

Let us develop a C++ program with the following requirements.

1. The program first creates an array of 20 random positive numbers between 1 and 100. Make sure there are no duplicates in the array.

2. Then apply bubble sort to sort the array in ascending order, then display the entire array.

3. Now, ask user to enter any number between 1 and 100.

4. Use binary search to check if the users number is contained in the array. If so, display yes with the index of the matching element. If not, display no.

5. Ask if the user wants to continue. If yes, return to Step 3. If no, terminate program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!