title: How can I build a proper constructor and destructor?
body: <blockquote>
  <p><strong>Question #1:</strong> How can I build a constructor set the value for <code>(R,PoF,PoR)</code>? I am trying to understand how constructor works but I guess I don't quite get it.</p>
  <p><strong>Question #2:</strong> Can I build destructor in this way, instead of the way I used in my program?</p>
  </blockquote>
  <pre><code>Circle::~Circle()
  {
      std::cout &lt;&lt; &quot;The fence would cost &quot; &lt;&lt; SwimmingPool.PerimeterP(r) &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;The road would cost &quot; &lt;&lt; SwimmingPool.AreaP(r) &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;Present by FF&quot; &lt;&lt; std::endl;
  }
  </code></pre>
  <p>I just want the cost to come out by itself, but I don't know how should I create destructor to do so.</p>
  <p><strong>Here is my full code:</strong></p>
  <pre><code>#include &quot;stdafx.h&quot;
  #include &quot;iostream&quot;
  
  
  const double PI = 3.1415926;
  
  class Circle
  {
  public:
      Circle();
      double AreaP(int r);
      double PerimeterP(int r);
      ~Circle();
  
  
  private:
      int R;
      int PoF;
      int PoR;
  };
  
  double Circle::AreaP(int r)
  {
      return ((r + R)*(r + R) - r*r)*PI*PoR;
  }
  
  double Circle::PerimeterP(int r)
  {
      return (r + R) * 2 * PI*PoF;
  }
  
  Circle::Circle()
  {
      int R = 3;
      int PoF = 35;
      int PoR = 20;
  }
  
  Circle::~Circle()
  {
      std::cout &lt;&lt; &quot;Present by FF&quot; &lt;&lt; std::endl;
  }
  
  int main()
  {
      int r;
      Circle SwimmingPool;
      std::cout &lt;&lt; &quot;Please input the radius of the Swimming Pool.&quot; &lt;&lt; std::endl;
      std::cin &gt;&gt; r;
      std::cout &lt;&lt; &quot;The fence would cost &quot; &lt;&lt; SwimmingPool.PerimeterP(r) &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;The road would cost &quot; &lt;&lt; SwimmingPool.AreaP(r) &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>