title: Squares as a Class
body: <p>This program declares the Square class and uses member functions to find the perimeter and area of the square</p>
  
  <p><strong>I didn't figure out what's wrong.  I think did most of it right.
  Please input  the length of the side of the square
  8
  The area  of the square is 81
  The perimeter of the square is 36</strong></p>
  
  <pre><code>// This program declares the Square class and uses member functions to find
  // the perimeter and area of the square
  #include &lt;iostream&gt;
  
  using namespace std;
  
  // FILL IN THE CODE TO DECLARE A CLASS CALLED Square. TO DO THIS SEE
  // THE IMPLEMENTATION SECTION.
  
  class Square
  {
        private:
          double Length;
        public:
          void setSide(float, double);
          double getArea(double);
          double getPerimeter(double);
  };
  
  
  
  int main()
  {
      Square box;         // box is defined as an object of the Square class
      double side; // size contains the length of a side of the square 
      double Length;
  
  
      // FILL IN THE CLIENT CODE THAT WILL ASK THE USER FOR THE LENGTH OF THE SIDE 
      // OF THE SQUARE. (This is stored in size)
      cout &lt;&lt; "What is the Length of the side of the square?"&lt;&lt;endl;
      cin &gt;&gt; Length;
  
      // FILL IN THE CODE THAT CALLS SetSide.
      box.setSide(Length, side);
  
      // FILL IN THE CODE THAT WILL RETURN THE AREA FROM A CALL TO A FUNCTION
      // AND PRINT OUT THE AREA TO THE SCREEN 
      cout&lt;&lt;"side: "&lt;&lt;side&lt;&lt;endl;
      cout &lt;&lt; "The area is "&lt;&lt; box.getArea(side)&lt;&lt;endl;
  
      // FILL IN THE CODE THAT WILL RETURN THE PERIMETER FROM A CALL TO A 
      // FUNCTION AND PRINT OUT THAT VALUE TO THE SCREEN 
      cout &lt;&lt; "The perimeter is " &lt;&lt; box.getPerimeter(side)&lt;&lt;endl;
      system("pause");
  
      return 0;
  }
  
  //__________________________________________________________________
  //Implementation section Member function implementation
  
  //**************************************************
  // setSide
  //
  // task: This procedure takes the length of a side and
  // places it in the appropriate member data
  // data in: length of a side
  //***************************************************
  
  void Square::setSide(float Length, double side)
  {
     Length = side;
  
  
  }
  
  //**************************************************
  // findArea
  //
  // task: This finds the area of a square
  // data in: none (uses value of data member side)
  // data returned: area of square
  //***************************************************
  
  double Square::getArea()
  {
      return Length * Length
  
  }
  
  //**************************************************
  // findPerimeter
  //
  // task: This finds the perimeter of a square
  // data in: none (uses value of data member side)
  // data returned: perimeter of square
  //*************************************************** 
  
  double Square::getPerimeter()
  {
      return Length * 4; 
  
  }
  </code></pre>