Answer:
std::string x[n];
int mode1count = 0; // msft
int mode2count = 0; // appl
int mode3count = 0; // csco
int mode4count = 0; // imb
int i;
for(i = 0; i < n; ++i) // Set the array of strings
x[i] = modeList[i];
for(i = 0; i < n; ++i)
{
if(x[i] == "msft")
++mode1count;
else if(x[i] == "appl")
++mode2count;
else if(x[i] == "csco")
++mode3count;
else if(x[i] == "imb")
++mode4count;
}
Explanation:
It is important to ensure that there is adequate space and necessary punctuation when developing codes and programming to avoid getting error messages when running the codes. In this problem, the codes required are shown in the answer section. The codes are properly writing and arranged.