so i need help trying to get the sequential search to where i need to have .
The function return the index where key is found or return -1 if not found and display a message if found or if not found
The numbers in the array are 80 32 20 16 10
=============
1: fill the array
2: print the array
3: calculate the average
4: show the highest number
5: double each number
6: selection sort in descending order
7: sequential search
8: show bar graph
9: quit
=============
Enter your choice:7
as well need help with bar graph to display like this mine isnt correct anything helps thank you
The numbers in the array are 20 16 32 80 10
=============
1: fill the array
2: print the array
3: calculate the average
4: show the highest number
5: double each
number
6: selection sort in descending order
7: sequential search
8: show bar graph
9: quit
=============
Enter your choice:
8
Slot 0: **
Slot 1: *
Slot 2: ***
Slot 3: ********
Slot 4: *
it doesnt display how i want it when i run it shows
The numbers in the array are 20 16 32 80 10
===================
1:Fill the array
2:Print the array
3:Calculate the average
4:Show the highest Number
5:Double each number
6:sort in descending order
7:Sequential Search
8:Show Bar Graph
9:Quit
===================
Enter your choice: 8
Slot 1 : ********************
Slot 2 : ****************
Slot 3 : ********************************
Slot 4 : ********************************************************************************
Slot 5 : **********
this is how it should be
Slot 1 : **
Slot 2 : *
Slot 3 : ***
Slot 4 : ********
Slot 5 : *
===================
so it displays the first number only
===================
1:Fill the array
2:Print the array
3:Calculate the average
4:Show the highest Number
5:Double each number
6:sort in descending order
7:Sequential Search
8:Show Bar Graph
9:Quit
===================
Enter your choice: 1
Enter a number 20
Enter a number 16
Enter a number 32
Enter a number 80
Enter a number 10
===================
1:Fill the array
2:Print the array
3:Calculate the average
4:Show the highest Number
5:Double each number
6:sort in descending order
7:Sequential Search
8:Show Bar Graph
9:Quit
===================
Enter your choice: 8
Slot 1 : ********************
Slot 2 : ****************
Slot 3 : ********************************
Slot 4 : ********************************************************************************
Slot 5 : **********
===================
so here is an example of what it should display
The numbers in the array are 10 8 16 40 5
=============
1: fill the array
2: print the array
3: calculate the average
4: show the highest number
5: double each number
6: selection sort in descending order
7: sequential search
8: show bar
graph
9: quit
=============
Enter your choice:
8
Slot 0: *
Slot 1:
Slot 2: *
Slot 3: ****
Slot 4:
so it displays the first number only
bool sequeSearch(constint ar[], int s, int k)
{
int temp=0;
for(int i=0;i<s;i++)
{
if(ar[i]==k)
{
temp=1;
break;
}
}
if(temp != 0)
{
cout << k << " was found at index " << i + 1 << endl;
}
return (temp == 1);
}