C++ Noobie - I cannot get past solving this for my homework assignment. I am stuck. Please help!
<p>"I cannot seem to get this C++ program to work!! I have been trying for a couple of hours, and I am not grasping the concept. Here is the question from the book:</p>

<p>"Write a C++ function:</p>

<pre><code>void rect (int&amp; ar, int&amp; per, int len, int wid)
</code></pre>

<p>that computes the area ar and perimeter per of a rectangle with length len and width wid. Test it with a main program that inputs the length and width of a rectangle and outputs its area and perimeter. Output the value in the main program, not in the procedure.</p>

<p>This is what is on the instructors instructions:</p>

<p>**#13 from text, pg 83: This program requires you to use a function that accepts the length and width of your rectangle from <code>main()</code>, calculates the area and perimeter and returns those values in variables <code>ar</code> and <code>per</code>. Your <code>main()</code> then displays these values. Variables <code>ar</code> and <code>per</code> must be declared in <code>main()</code> and then passed by reference to method <code>rect()</code>.</p>

<p>Here is the code that I have written so far. I am stuck on passing the variable by reference to the method rect():</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

void rect(int&amp; ar, int&amp; per, int len, int wid)
{
   ar = len * wid;
   cout &lt;&lt; "Area: " &lt;&lt; ar &lt;&lt; ".";
}

int main ()
{
   int ar, per, len, wid;
   cout &lt;&lt; "Please enter the length of the rectangle: ";
   cin &gt;&gt; len;
   cout &lt;&lt; "Please enter the width of the rectangle: ";
   cin &gt;&gt; wid;

   return 0;
}
</code></pre>

<p>I know that the calculation is ok in the rect() method because it is compiling correctly. What I cannot figure out is how to call the rect() method from main. Every time I try something, it give me an 'too few arguments to function <code>'void rect(int&amp;, int&amp;, int, int)' error.</code></p>

<p>I am using JGrasp on OS X as my IDE.</p>

<p>Please help!!"</p>
