title: Max value function for an array
body: <p>I have read in a file, sorted the file by into three columns and put all of the data in each columns into 3 arrays. I now need to make a method to get the max value out of the second column array. This is the code:</p>
  
  <pre><code>static void Main(string[] args) 
  { 
      string file1 = System.IO.File.ReadAllText(@"C:\file1.txt");
  
      List&lt;double&gt; Array1 = new List&lt;double&gt;();
      List&lt;double&gt; Array2 = new List&lt;double&gt;();
      List&lt;double&gt; Array3 = new List&lt;double&gt;();
  
      IEnumerable&lt;string&gt; lines = File.ReadLines(@"C:\File1.txt");
  
      foreach (string line in lines)
      {
          string[] columns = line.Split(',');
  
          if (columns.Length != 3)
          {
              continue; // skips this line
          }
  
          Array1.Add(Convert.ToDouble(columns[0]));
          Array2.Add(Convert.ToDouble(columns[1]));
          Array3.Add(Convert.ToDouble(columns[2]));
      }
  
  Console.WriteLine(Max(Array1.ToArray()));
  }
  static double Max (double[] x)
  {
      double maxValue = x.Max();
      return maxValue;
  }
  </code></pre>
  
  <p>ERROR: Type or namespace definition, or end-of-file expected.</p>
  
  <p>I need to fix the Max Method and also I do not know how to Say that it is Array 2 that we need to get the max value of. I then need to go back up to the main and Use the Max Method to get the maximum value of array 2. Clearly their are beginners errors in the Max function but I have researched the problem andI am unsure of how to proceed.</p>