Answered step by step
Verified Expert Solution
Link Copied!

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 =0; i < numElements; ++i){
cin >> stringVal;
cin >> intVal;
subjectList.push_back(stringVal);
pageList.push_back(intVal);
}
cin >> pageThreshold;
/* Your code goes here */
cout << "Total: "<< matchCount;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago