title: Inputing info from a structure to an array
body: <p>Been trying to figure out how to input information into an array and output it from structured variables. I can input and output the information easy without using arrays, however I am trying have a list of workers inputed from the keyboard. I also need to calculate the wage earned for each worker, but If I can just figure out the format of the simple information from the first three variables I can figure that part out on my own. I have tried to call the input function in the array but have had no success so I just deleted it and left the functions.</p>
  
  <p><code></p>
  
  <pre><code> #include&lt;iostream&gt;
  
  
  using namespace std;
  
  struct Worker
  
  {
  
      int idNumber;
      int hoursWorked;
      double hourlyRate;
      double earned;
  
  };
  
  void input(Worker &amp; theData);
  //Postcondition: theData.idNumber, theData.hoursWorked, and theData.hourlyRate are given input values
  // the user must input into these values.
  void print(const Worker &amp;);
  
  void input(Worker[], int howMany);
  
  void  print(const Worker[], int);
  
  
  
  void main()
  {
      Worker arr[10];
      Worker Data;
      input(Data);
      print(Data);
  
      input(arr[10],7);
  
      system("pause");
  
  }
  
  void input(Worker&amp; theData) {
      cout &lt;&lt; "Enter the Employee idNumber ";
      cin &gt;&gt; theData.idNumber;
      cout &lt;&lt; "Enter the Hours Worked. ";
      cin &gt;&gt; theData.hoursWorked;
      cout &lt;&lt; "Enter the HoutlyRate for under 41 hours. ";
      cin &gt;&gt; theData.hourlyRate;
  }
  
  void input(Worker arr[], int howMany)
  {
      for (int i = 0; i &lt; howMany; i++)
      {
          input(arr[i]);
      }
  }
  
  void print(const Worker&amp; w) {
      cout &lt;&lt; w.idNumber &lt;&lt; "\n" &lt;&lt; w.hoursWorked &lt;&lt; "\n" &lt;&lt; w.hourlyRate &lt;&lt; "\n" &lt;&lt; w.earned &lt;&lt; endl;
  }
  
  void print(const Worker arr[], int howMany)
  {
      for (int i = 0; i &lt; howMany; i++)
      {
          print(arr[i]);
      }
  }
  </code></pre>
  
  <p></code></p>