Question: Integer dataSize is read from input. The remaining input alternates between strings and integers. Declare string vector tintList and integer vector quantityList, each with dataSize
Integer dataSize is read from input. The remaining input alternates between strings and integers. Declare string vector tintList and integer vector quantityList, each with dataSize elements. Then, read and store all the strings into tintList and all the integers into quantityList.
Ex: If the input is:
3 plum 49 gray 52 orchid 61
Then the output is:
Tint: plum, Quantity: 49 Tint: gray, Quantity: 52 Tint: orchid, Quantity: 61
#include
int main() { int dataSize; unsigned int i; cin >> dataSize;
/* Your code goes here */ for (i = 0; i < tintList.size(); ++i) { cout << "Tint: " << tintList.at(i) << ", "; cout << "Quantity: " << quantityList.at(i) << endl; } return 0; }
C++ please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
