Please find the code below:::
#include<iostream>
#include<vector>
#include<string>
using namespace std;
bool search(vector<string> names,string name){
for(unsigned int i=0;i<names.size();i++){
if(names[i]==name){
return
true;
}
}
return false;
}
int main()
{
vector<string> names;
cout<<"Enter first names (zzz to end the
input)"<<endl;
string name;
while(true){
cin>>name;
if(name=="zzz"){
break;
}else{
names.push_back(name);
}
}
string searchme;
cout<<"Enter the name to be searched : ";
cin>>searchme;
if(search(names,searchme)){
cout<<searchme<<" is
found in the list."<<endl;
}else{
cout<<searchme<<" is
not in the list."<<endl;
}
return 0;
}
output:
![Console 3 terminated> CPP Workspace.exe [C/C++ Application] CAUsers Mo Enter first names (zzz to end the input) salman khan h](http://img.homeworklib.com/questions/9b182a50-982b-11eb-baaa-5bebb52df948.png?x-oss-process=image/resize,w_560)
![Console X terminated> CPP Workspace.exe [C/C++ Application] CAUsers Mo Enter first names (zzz to end the input) salman khan h](http://img.homeworklib.com/questions/9b667590-982b-11eb-8264-5797f3fe0db6.png?x-oss-process=image/resize,w_560)
c++ O fe/C/Users/Younis/App ft.Microsoftedgc s Ass06 W19 204).pdf 2 of 2 Question 04 (20 points) Write...
C++ Create an application that searches a file of male and female first names. A link to the file is provided on the class webpage. "FirstNames2015.txt" is a list of the most popular baby names in the United States and was provided by the Social Security Administration. Each line in the file contains a boy's name and a girl's name. The file is space-delimited, meaning that the space character is used to separate the boy name from the girl name....