Home / Expert Answers / Computer Science / in-c-integer-datasize-is-read-from-input-then-strings-and-integers-are-read-and-stored-into-str-pa845

(Solved): in C++, Integer dataSize is read from input. Then, strings and integers are read and stored into str ...



student submitted image, transcription available belowstudent submitted image, transcription available belowstudent submitted image, transcription available belowin C++, Integer dataSize is read from input. Then, strings and integers are read and stored into string vector inventoryList and integer vector quantityList, respectively. Lastly, integer quantityThreshold is read from input.

  • Set matchesFound with the number of element pairs with a quantity greater than or equal to quantityThreshold.
  • Output the inventory of each pair found with a quantity greater than or equal to quantityThreshold. End with a newline.

Ex: If the input is:

3 desk 61 cradle 59 shoerack 80 57

Then the output is:

desk cradle shoerack Total: 3
for inventoryList.size () cin inventoryList.at(i); cin quantityList.at(i); \} cin quantityThreshold; Your code goes here */ cout "Total: " matchesFound; return 0; \} Integer dataSize is read from input. Then, strings and integers are read and stored into string vector inventoryList and integer vector quantityList, respectively. Lastly, integer quantityThreshold is read from input. - Set matchesFound with the number of element pairs with a quantity greater than or equal to quantityThreshold. - Output the inventory of each pair found with a quantity greater than or equal to quantityThreshold. End with a newline. Ex: If the input is: 3 desk 61 cradle 59 shoerack 80 57 Then the output is: desk cradle shoerack Total: 3 int quantityThreshold; int matchesFound; unsigned int ; cin numElements; vector inventoryList (numElements); vector quantitylist(numElements); for ( inventoryList.size (); ++i) \{ cin inventoryList.at(i); cin quantityList.at(i); \} cin quantityThreshold; Your code goes here */ \#include \#include using namespace std; int main() \{ int numElements; int quantityThreshold; int matchesFound; unsigned int i; cin ?> numElements; vector inventoryList(numElements); vector quantityList(numElements); for (i ; i i inventoryList.size(); ++i) \{ \#include \#include using namespace std; int int numElements; int quantityThreshold; int matchesFound; unsigned int ; cin >> numElements; vector inventoryList (numElements); vector quantityList(numElements); for ( inventoryList.size () cin inventoryList.at(i); cin quantityList.at


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe