Question: Please use C + + ! ! ! Integer inputSize is read from input. Then, strings and integers are read and stored into string vector
Please use C
Integer inputSize is read from input. Then, strings and integers are read and stored into string vector nameList and integer vector ageList, respectively. Lastly, integer ageThreshold is read from input.
Initialize indexFound with
Find the first element pair with an age greater than ageThreshold. If the element pair is found, assign indexFound with the index of the element pair and output the name and age, separated by a space. End with a newline.
Ex: If the input is:
Gus Dax Ana Meg
Then the output is:
Gus
Found at entry
#include
#include
using namespace std;
int main
int numElements;
int ageThreshold;
int indexFound;
unsigned int i;
cin numElements;
vector nameListnumElements;
vector ageListnumElements;
for i ; i nameList.size; i
cin nameList.ati;
cin ageList.ati;
cin ageThreshold;
Your code goes here
if indexFound
cout No result" endl;
else
cout "Found at entry indexFound endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
