Question: I need the flowchart for the following code, please make it for me , the code is performing searching and sorting, see the code and

I need the flowchart for the following code, please make it for me, the code is performing searching and sorting, see the code and then do the flowchart. I only need flowchart
#include
using namespace std;
// Function Prototype
void BubbleSort(int[], int);
int BinarySearch(int[], int, int);
int main(){
const int SIZE =50;
int arr[SIZE], input, SearchValue, results;
cout<<"How many values would you like to input? " ;
cin >> input;
for (int i =0; i < input; i++){
cout << "Please enter value "<<(i +1)<<": ";
cin >> arr[i];
}
cout << "The array entered is: "<< endl;
for (int i =0; i < input; i++){
cout << arr[i]<<"";
}
cout << endl;
BubbleSort(arr, input);
cout << "The sorted array entered is: "<< endl;
for (int i =0; i < input; i++){
cout << arr[i]<<"";
}
cout << endl;
cout << "Please enter the value you want to search: ";
cin >> SearchValue;
results = BinarySearch(arr, SIZE, SearchValue);
if (results ==-1){
cout << "That number does not exist in the array." << endl;
}
else {
cout << "That number is found at element "<< results <<" in the array.";
}
return 0;
}
void BubbleSort(int arr[], int SIZE){
bool swap;
int temp;
do {
swap = false;
for (int count =0; count <(SIZE -1); count++){
if (arr[count]> arr[count +1]){
temp = arr[count];
arr[count]= arr[count +1];
arr[count +1]= temp;
swap = true;
}
}
} while (swap);
}
int BinarySearch(int array[], int numElems, int value){
int first =0;
int last = numElems -1;
int middle;
while (first <= last)
{
middle = first +(last - first)/2;
if (array[middle]== value){
return middle;
}
else if (array[middle]< value){
last = middle -1;
}
else {
first = middle +1;
}
}
return -1;
}

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 Programming Questions!