Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 ;
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started