title: Patterning COUT by inches/feet of pallets (C++ help)
body: <p>doin a little project to try and better my C++ knowledge, I might be doing it wrong and any guidance in the right direction would be more than appreciated. Just a heads up I am an amateur when it comes to C++..</p>
  
  <p>What im trying to do: 
  Make a program that calculates pallets in a commercial truck, our standard truck dimensions are 96 inches (or 8 ft) in width and 636 inches (or 53 ft) in length.</p>
  
  <p>Pallet sizes can vary, and I need two dims from them (length/width). </p>
  
  <p>When it comes to standard pallets (40 inches by 48 inches) you can fit 30 pallets total: 15 of them side by side.</p>
  
  <p>If one pallet is 53x50 and one is 47x51, these two wouldn't fit together because it exceeds the limit of 96 OR less inches.</p>
  
  <p>I need this program to make it so it adds all different types of sizes and shows it in a rectangle "cout" format by placing pallets together to fit in the way that saves the most space. </p>
  
  <p>I assume this would require if, then statements when outputting dims into the "trailer"</p>
  
  <p>Example:</p>
  
  <p>If I had 7 pallets total with the following dims (in inches):</p>
  
  <p>101x57, 45x31, 101x43, 107x43, 124x61, 96x18, 56x49</p>
  
  <p>Out put in the box "trailer" would be:</p>
  
  <p>EDIT: edited output of the trailer example</p>
  
  <pre><code>--------------------
  | 101x57     45x31 |
  |                  |
  |           107x43 |
  |                  |
  | 101x43           |
  |            96x18 |
  |                 
  | 124x61     56x49 |   
  |                  |
  |                  |
  |                  |
  |                  |
  |                  |
  --------------------
  </code></pre>
  
  <p>This is the most efficient way to pattern them with saving the most space.</p>
  
  <p>// CODE BELOW: I know its not much, but I just started and I'm already stuck :/</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  double p1d1, p1d2, p2d1, p2d2, p3d1, p3d2, p4d1, p4d2, p5d1, p5d2, p6d1, p6d2, p7d1, p7d2, p8d1, p8d2;
  double palletSize2;
  
  const double pRSize = 96.001;
  
  int main()
  {
  
      cout &lt;&lt; "Partial Counter 1.0" &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter pallet sizes one at a time " &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #1 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dims: ";
      cin &gt;&gt; p1d1 &gt;&gt; p1d2;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p1d2;
      cout &lt;&lt; "Pallet #1 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #2 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p2d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p2d2;
      cout &lt;&lt; "Pallet #2 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #3 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p3d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p3d2;
      cout &lt;&lt; "Pallet #3 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #4 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p4d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p4d2;
      cout &lt;&lt; "Pallet #4 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #5 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p5d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p5d2;
      cout &lt;&lt; "Pallet #5 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #6 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p6d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p6d2;
      cout &lt;&lt; "Pallet #6 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #7 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p7d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p7d2;
      cout &lt;&lt; "Pallet #7 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
      cout &lt;&lt; endl;
      cout &lt;&lt; "Enter Pallet #8 dims" &lt;&lt; endl;
      cout &lt;&lt; "Dim 1: ";
      cin &gt;&gt; p8d1;
      cout &lt;&lt; "Dim 2: ";
      cin &gt;&gt; p8d2;
      cout &lt;&lt; "Pallet #8 Dims = " &lt;&lt; p1d1 &lt;&lt; "x" &lt;&lt; p1d2 &lt;&lt; endl;
  
  
      cout &lt;&lt; " ------------------------------" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; "|                              |" &lt;&lt; endl;
      cout &lt;&lt; " -----------------------------" &lt;&lt; endl;
  
  
  
  }
  </code></pre>