subject

What does the following code do?

#include
#include
#include
using namespace std;

//Function Prototype Declaration

bool seqsearch(vectorlist, string str);
void main()
{
//variable declaration
vectorlist;
string s, ser_str;
bool found;
int i, n;

//inputting the number of strings
cout << "Enter number of strings: ";
cin >> n;

//inputting strings into vector "list"

for (i=0; i {
cin >> s;
list. push_back(s);
}
cout << "Enter string to be searched: ";
cin >> ser_str;

//function call
found=seqsearch(list, ser_str);
if(found)
cout << "String found in Vector " << endl;
else
cout << "String not found in Vector." << endl;
system("pause");
} // end main
//Function Definition

bool seqsearch(vectorlist, string str)
{
bool found=false;
int i;
for (i=0; i {
if(list[i]==str)
{ found=true;
break;
}
}
return found;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
You know the right answer?
What does the following code do?

#include
#include
#include
using nam...
Questions
question
SAT, 23.03.2021 01:40
question
Mathematics, 23.03.2021 01:40
question
Social Studies, 23.03.2021 01:40
question
History, 23.03.2021 01:40
question
Mathematics, 23.03.2021 01:40
Questions on the website: 13722367