Ask Question
8 April, 13:03

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; }

+4
Answers (1)
  1. 8 April, 16:36
    0
    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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “std::string x[n]; int mode1count = 0; / / msft int mode2count = 0; / / appl int mode3count = 0; / / csco int mode4count = 0; / / imb int i; ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers