Question: 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 #include using namespace std;

int main() { int numElements; string tintAsked; int sumQuantity; unsigned int i; cin >> numElements;

vector tintList(numElements); vector quantityList(numElements);

for (i = 0; i > tintList.at(i); cin >> quantityList.at(i); }

cin >> tintAsked;

/* Your code goes here */ cout

return 0; }

Please type in C++ #include #include using namespace std; int main() {

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: 80

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!