title: When I minus a “double” and a another “double” from an arrary, "class member declaration expected"
body: <p>Thank you for helping me!
  I made two array which contains a few double numbers. I then made a function to randomly get a double out of an array. When I try to subtract a double and the double I extracted from two arrays, mistake happens in the last three lines——</p>
  
  <blockquote>
    <p>class member declaration expected. </p>
  </blockquote>
  
  <p>How should I alter my code to avoid this problem?</p>
  
  <pre><code>public partial class MainWindow : Window
  {   
  
      double[] x =new Double[] { 30,35,40,45,55 };
      double[] y =new Double[] { 700,750,800,850,900 };
  
      double a;
      double b;
      double distance;
  
      public string GetRandom(arr)
     {   
  　　　　Random ran = new Random();
  　　　　int n = ran.Next(arr.Length - 1);
  　　　　return arr[n];
  　　}
  
        distance = GetRandom(y)
        a = a - distance;
        b.SetValue(Canvas.LeftProperty,a-GetRandom(x));
  }
  </code></pre>
  
  <p>Thank you!</p>