title: Check if a specific point x,y is inside a rectangle
body: <p>I'm trying to write program which specifies a rectangle via its width and height and its top and left corner point. I want the program to allow a user to input a point x,y after which my goal is to have the program determine whether the point is inside the rectangle.</p>
  
  <p>Here is my code so far, but I'm not sure how to proceed. Can anyone help me with the implementation of <code>bool Rectangle.Contains(x, y)</code>?</p>
  
  <pre><code>public struct Rectangle
  {
      // declare the fields
      public int Width;
      public int Height;
      public int Top;
      public int Left;
  
      // define a constructor
      public Rectangle(int Width, int Height, int Top, int Left)
      {
          this.Width = Width;
          this.Height = Height;
          this.Top = Top;
          this.Left = Left;
      }
  
      public bool Contains(int x, int y) { }
  }
  
  class MainClass
  {
      public static void Main()
      {
           Console.WriteLine("Creating a Rectangle instance");
           Rectangle myRectangle = new Rectangle(6, 2, 1, -1);
  
           Console.WriteLine("myRectangle.Width = " + myRectangle.Width);
           Console.WriteLine("myRectangle.Height = " + myRectangle.Height);
           Console.WriteLine("myRectangle.Top = " + myRectangle.Top);
           Console.WriteLine("myRectangle.Left = " + myRectangle.Left);
      }
  }
  </code></pre>