Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Integer numElements is read from input. Then, numElements pairs of strings and integers are read and stored into string vector subjectList and integer vector pageList,
Integer numElements is read from input. Then, numElements pairs of strings and integers are read and stored into string vector subjectList and integer vector pageList, respectively. Lastly, integer pageThreshold is read from input.
Set matchCount with the number of element pairs with a page less than pageThreshold.
Output the subject of each pair found with a page less than pageThreshold. End with a newline.
#include
#include
using namespace std;
int main
vector subjectList;
vector pageList;
int numElements;
int pageThreshold;
int matchCount;
unsigned int i;
string stringVal;
int intVal;
cin numElements;
for i ; i numElements; i
cin stringVal;
cin intVal;
subjectList.pushbackstringVal;
pageList.pushbackintVal;
cin pageThreshold;
Your code goes here
cout "Total: matchCount;
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