Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please type in C++ #include #include using namespace std; int main() { int numElements; string tintAsked; int sumQuantity; unsigned int i; cin >> numElements; vector
Please type in C++
#include
int main() { int numElements; string tintAsked; int sumQuantity; unsigned int i; cin >> numElements;
vector
for (i = 0; i > tintList.at(i); cin >> quantityList.at(i); }
cin >> tintAsked;
/* Your code goes here */ cout
return 0; }
Integer inputSize is read from input. Then, strings and integers are read and stored into string vector tintList and integer vector quantityList, respectively. Lastly, string tintAsked is read from input. - Find the sum of the elements in quantityList where the corresponding element in tintList is equal to tintAsked. - For each element in tintList that is equal to tintAsked, output "Index " followed by the element's index. End with a newline. Ex: If the input is: 4 turquoise 41 yellow 64 turquoise 39 plum 165 turquoise Then the output is: Index 0 Index 2 Total: 80Step 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