// arrayforloop_01.cpp using for loops and arrays
#include <iostream>

int main() {
  using namespace std;
  // using constant numNames to make it more flexible
  const int numNames = 6;
  string names[numNames];

  cout << "This program will ask you to enter " << numNames << " names.\n";

  // using a loop from 0 to numNames constant to ask you 'numNames' names.
  // NOTE if BODY is more than two line you need curly brackets
  for(int i=0;i<numNames;i++) {
    cout << "\nPlease enter a name: ";
    cin >> names[i];
  }

  cout << "\nThe program will now output all your names using a for loop.\n\n";
  // will print out the names
  // NOTE if BODY is only one line, needs no curly brackets
  for(int i=0;i<numNames;i++)
    cout << names[i] << endl;

}
