title: C++ yard.h header getting acreage programmatically
body: <p>I am relatively new to C++ and it is essentially just a filler class for my college. I am stuck on this yard program. I need to create a header with the requirements below:</p>
  <p>following 5 public functions in the Yard class:
  <code>getWidth()</code>, <code>setWidth()</code>, <code>getLength()</code>, <code>setLength()</code>, and <code>getAcres()</code></p>
  <p>Validate the width and length to ensure they are not negative</p>
  <p>FYI: There are 43560 square feet in an acre.</p>
  <p>NOTE: I have yet to learn anything about headers , classes, objects.</p>
  <p>here is the premade code given to me from teacher:</p>
  <pre><code>// Yard class 
  
  class Yard 
  { 
  private:
      double width, length; // Feet
  
  public:
  };
  
  // C++ Classes end with a semicolon!
  
  //Program requirements:
  //⦁ Create the following 5 public functions in the Yard class://
  //⦁ getWidth(), setWidth(), getLength(), setLength(), and getAcres() 
  //⦁ The main() driver code is already setup to use these 5 functions
  //⦁ Validate the width and length to ensure they are not negative
  //⦁ FYI: There are 43560 square feet in an acre
  
  </code></pre>
  <p>here is the code the teacher has set me up in main.cpp:</p>
  <pre><code>/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo/
  /O::::::::::::::::::::::::::::::::::::::::::::::::O/
  /o:::::::::::Programmer: Tristan Moore::::::::::::o/
  /:::::::::::::::::Date: 02/07/2021::::::::::::::::o/
  /O::::::::::::::::::::::::::::::::::::::::::::::::O/
  /oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo*/
  
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  #include &quot;yard.h&quot;
  
  using namespace std;
  
  int main()
  {
      /////////////////////////
      //                     //
      //   MINI PROGRAM #3   //
      //                     //
      /////////////////////////
  
      Yard yard1, yard2, yard3;
      double length, width;
  
      cout &lt;&lt; endl;
      cout &lt;&lt; &quot;------------------------------------------------------&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;INPUTTING WIDTH (FT) AND LENGTH (FT), OUTPUTTING ACRES&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;------------------------------------------------------&quot; &lt;&lt; endl;
      cout &lt;&lt; endl;
  
      yard1.setLength(150);
      yard1.setWidth(75);
  
      yard2.setLength(220);
      yard2.setWidth(200);
  
      // Input
      cout &lt;&lt; &quot;Enter the length of your Yard (ft): &quot;;
      cin &gt;&gt; length;
      cout &lt;&lt; &quot;Enter the width of your Yard (ft): &quot;;
      cin &gt;&gt; width;
  
      if (length &lt; 0){
          length = 0;
      }
  
      if (width &lt; 0){
          width = 0;
      }
  
      //set Width
      //set Length
  
      cout &lt;&lt; endl &lt;&lt; fixed &lt;&lt; setprecision(2);
  
      // Output
      cout &lt;&lt; &quot;Acres in Yard #1 (&quot; &lt;&lt; yard1.getLength() &lt;&lt; &quot;ft X &quot; &lt;&lt; yard1.getWidth() &lt;&lt; &quot;ft): &quot; &lt;&lt; yard1.getAcres() &lt;&lt; endl;
      cout &lt;&lt; &quot;Acres in Yard #2 (&quot; &lt;&lt; yard2.getLength() &lt;&lt; &quot;ft X &quot; &lt;&lt; yard2.getWidth() &lt;&lt; &quot;ft): &quot; &lt;&lt; yard2.getAcres() &lt;&lt; endl;
      cout &lt;&lt; &quot;Acres in Yard #3 (&quot; &lt;&lt; yard3.getLength() &lt;&lt; &quot;ft X &quot; &lt;&lt; yard3.getWidth() &lt;&lt; &quot;ft): &quot; &lt;&lt; yard3.getAcres() &lt;&lt; endl;
      cout &lt;&lt; endl;
  }
  </code></pre>
  <p>My question is since I am new to Headers, Classes, And Objects. How do I go about creating a working header that has the above 5 functions?</p>