title: How would i change the display of the arrays from numbers to strings C++
body: <p>it is precoded and is an assignment i cant figure it out without changing most of the code any help would be appreciated thank you. when you run the program its like farmville and the code will display the "land" as 0 1 2 3 4 5 6 one of those the assignment is to change those 0 1 2 ect.. to be be able to say "unplowed" "plowed" "dead" ect. ive tried multiple things and i cant figure it out for the life of me thank you for any insight you have</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;time.h&gt;
  #include &lt;windows.h&gt; // WinApi header
  #include &lt;stdlib.h&gt;
  #include &lt;MMSystem.h&gt;
  #include &lt;string.h&gt;
  #include &lt;string&gt;
  
  
  
  using namespace std;
  
  
  
  // Constants
  const int SIZE_OF_FARM = 5;
  
  // Global variables
  int farmGrid[SIZE_OF_FARM];  // Declare 5 squares as size of your farm.
  int coins = 300;
  
  // Function declarations
  void doGameLoop();
  void sleep(unsigned int mseconds);
  void plowTheLand();
  void displayTheFarm();
  void seedTheLand();
  void harvestTheLand();
  void beep();
  
  void main() // START HERE!
  {
  
      /*
         Initialize the farmGrid array.
         A value of 0 means fallow ground (unplowed),
                    1 means plowed,
                    2 means seeded with strawberries,
                    3 means growing,
                    4 means died,
                    5 means ripe,
                    6 means harvested
      */
      farmGrid[0] = 0;
      farmGrid[1] = 0;
      farmGrid[2] = 0;
      farmGrid[3] = 0;
      farmGrid[4] = 0;
  
      doGameLoop();
  }
  
  void displayTheFarm()
  {
      //system("cls");
      cout &lt;&lt; endl;
  
      for (int i=0; i&lt;SIZE_OF_FARM; i++)
      {
          cout &lt;&lt; farmGrid[i] &lt;&lt; endl;
      }
  }
  
  /*
     Delaying example: sleep(3000); // Delays for 3 seconds.
  */
  void sleep(unsigned int mseconds)
  {
      clock_t goal = mseconds + clock();
      while (goal &gt; clock());
  }
  
  void doGameLoop()
  {
      char response = ' ';  // defaults to nothing
  
      do
      {
          displayTheFarm();
  
          cout &lt;&lt; endl;
          // I input a color for the display here
          system("Color F3");
          // END
  
          cout &lt;&lt; "&lt;&lt;&lt; Menu - Coins=" &lt;&lt; coins &lt;&lt; " &gt;&gt;&gt;" &lt;&lt; endl;
          cout &lt;&lt; "P - Plow" &lt;&lt; endl;
          cout &lt;&lt; "S - Seed" &lt;&lt; endl;
          cout &lt;&lt; "H - Harvest" &lt;&lt; endl;
          cout &lt;&lt; "X - eXit" &lt;&lt; endl;
          cout &lt;&lt; "Select a letter: ";
          cin &gt;&gt; response;
  
           if (response == 'P'  ||  response == 'p')
          {
              plowTheLand();
              //ADDED SOUND TO INPUTS---------------------------------------------
              PlaySound("C:\\SOUNDS\\BELLS.WAV", NULL, SND_ASYNC);
              //----------------------------------------------------------------------------
              //   _------------------------------------------------------------------------
          }
          else if (response == 'S'  ||  response == 's')
          {
              seedTheLand();
              //ADDED SOUND TO INPUTS---------------------------------------------
              PlaySound("C:\\SOUNDS\\BELLS.WAV", NULL, SND_ASYNC);
              //----------------------------------------------------------------------------
              //   _------------------------------------------------------------------------
          }
          else if (response == 'H'  ||  response == 'h')
          {
              harvestTheLand();
              //ADDED SOUND TO INPUTS---------------------------------------------
              PlaySound("C:\\SOUNDS\\BELLS.WAV", NULL, SND_ASYNC);
              //----------------------------------------------------------------------------
              //   _------------------------------------------------------------------------
          }
          else
          {
              beep(); // Audible sound for invalid entry.
          }
      } while( response != 'x'  &amp;&amp;  response != 'X' );
  }
  
  void plowTheLand()
  {
      if (farmGrid[0] == 0) // if fallow ground then you may plow
      {
          farmGrid[0] = 1;
          farmGrid[1] = 1;
          farmGrid[2] = 1;
          farmGrid[3] = 1;
          farmGrid[4] = 1;
          coins = coins - 25; // cost 10 per plot.  CHANGED TO 5 COINS
      }
      else
      {
          beep();
      }
  }
  
  void seedTheLand()
  {
      if (farmGrid[0] == 1) // if plowed ground then you may seed.
      {
          // Plant seed, cost 50 per plot.
          farmGrid[0] = 2;
          farmGrid[1] = 2;
          farmGrid[2] = 2;
          farmGrid[3] = 2;
          farmGrid[4] = 2;
          coins = coins - 250;
          displayTheFarm();
  
          sleep(5000); // wait 5 seconds
  
          // Now they are ripe.
          farmGrid[0] = 5;
          farmGrid[1] = 5;
          farmGrid[2] = 5;
          farmGrid[3] = 5;
          farmGrid[4] = 5;
      }
      else
      {
          beep();
      }
  }
  
  void harvestTheLand()
  {
      if (farmGrid[0] == 5) // if ripe then you may harvest.
      {
          // Harvest, street value of 100 per strawberry.
          farmGrid[0] = 6;
          farmGrid[1] = 6;
          farmGrid[2] = 6;
          farmGrid[3] = 6;
          farmGrid[4] = 6;
          coins = coins + 500; 
          displayTheFarm();
  
          sleep(5000); // wait 5 seconds
  
          // Now they are fallow ground again.
          farmGrid[0] = 0;
          farmGrid[1] = 0;
          farmGrid[2] = 0;
          farmGrid[3] = 0;
          farmGrid[4] = 0;
      }
      else
      {
          beep();
      }
  }
  
  void beep()
  {
      Beep(523,100); // 523 hertz (C5) for 100 milliseconds
      //Beep(587,500);
      //Beep(659,500);
      //Beep(698,500);
      //Beep(784,500);
  }
  </code></pre>