Determine the output of the program below You will receive n

Determine the output of the program below. You will receive no credit for a submission that shows no work. You must make variable tables and show how the values of the variables change as the program executes.

#include

#include

using namespace std;

string makeWord(int num [], int total)

{

      string alpha = \"abcdefghijklmnopqrstuvwxyz\";

string returnWord = \"\";

      for (int i = 0; i < total; i++)

            returnWord = returnWord + alpha[num[i]];

           

      return returnWord;

}

void fillArray(int numbers [], int set)

{

      if (set == 0)

      {     numbers[0] = 19;

            numbers[1] = 17;

            numbers[2] = 8;

            numbers[3] = 2;

            numbers[4] = 10;

            numbers[5] = numbers[6] = 24;

      }

      else

      {     numbers[2] = 4;

            numbers[3]--;

            numbers[3]--;

            numbers[4] = numbers[0];

      }

}

int getNum(int& numbers)

{

      int i = numbers * 100 - (10 % 3);

      numbers++;

      return i;

      numbers--;

}

int main()

{

      int numbers[7];

      for (int i = 0; i < 3; i++)

      {

            fillArray(numbers, i);

            cout << makeWord(numbers, 5);

            if (getNum(i) < 0)

cout << \" or \";

            else

cout << \"!\ \";

      }

}

*Output is \"Trick or Treat!\" I just need to do the variable tables.You may need to add more rows.

Example Variable Tables:

main function

makeWord function

fillArray function:

i loop counter Numbers makeWord return value getnum return value
0
1
2

Solution

makeWord function

fillArray function:

i loop counter Numbers makeWord return value getnum return value
0 19, 17, 8, 2, 10, 24, 24 trick -1
1 -- -- --
2 19, 17, 4, 0, 19, 24, 24 treat 199
Determine the output of the program below. You will receive no credit for a submission that shows no work. You must make variable tables and show how the values
Determine the output of the program below. You will receive no credit for a submission that shows no work. You must make variable tables and show how the values

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site