Please help.

Feb 10, 2021 at 3:46am
Can someone please help me with this code? I am fairly new to programming and don't want this code to fail. I am having a hard time doing this.
1) Add the binarySearch function to the program
2) Change the binarySearch function to work with strings rather than integers
3) Prompt user for animal name
4) Call the binarySearch function to search for the animal name
5) Provide a message to the user indicating that the animal name was found or not found in the list (array)

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
using namespace std;

void main()
{
	const int NUM_NAMES = 10;
	string names[NUM_NAMES] = { "baboon", "giraffe", "hippopotamus", "lion", "monkey", "rhinoceros", "tapir", "tiger", "wildebeest", "zebra" };
	
	//Insert your code to complete this program

	return;
}
Feb 10, 2021 at 6:36am
Your "final project" was 3 months ago.
https://www.cplusplus.com/forum/beginner/274057/

Did you start by typing "binary search" into your favourite search engine?
Here, let me help you -> https://en.wikipedia.org/wiki/Binary_search_algorithm

> string names[NUM_NAMES] = { "baboon",
Step 2 suggests you should have started with integers before changing to strings.
Feb 10, 2021 at 7:50am
Thanks for the info "buddy!"
Topic archived. No new replies allowed.