title: Java make rows and columns
body: <p>Building a rectangular with character input and specified column and rows. whitespace in the middle.   </p>
  
  <p>using standard input for string s, int r, int c</p>
  
  <pre><code>private static void printstuff(String s, int r, int c) {
  
      colums(s, c);
      rows(s, c, r);
      colums(s, c);
  
  }
  
  // straight columns 
  
  private static void colums(String cs, int cc) {
      for (int i = 1; i &lt;= cc; i++) {
          System.out.print(cs);
      }
  
  }
  </code></pre>
  
  <p>this creates desired whitespace or "" to concat string with ie making 
      x""""""""x</p>
  
  <pre><code>private static String whitespace(int wc) {
      String ws = " ";
      for (int i = 1; i &lt;= wc - 3; i++) {
          ws += " ";
      }
      return ws;
  }
  </code></pre>
  
  <p>whitespace to built a rectangular.</p>
  
  <pre><code>// downwards building
  
  private static void rows(String rs, int rc, int rr) {
      String ws = whitespace(rc);
      for (int i = 1; i &lt;= rr - 1; i++) {
          System.out.println(rs + ws + rs);
  
          // put strings together
  
      }
  
  }
  </code></pre>
  
  <p>}
  whitespace and character rows to built a rectangular. needless to say it failed.</p>
  
  <p>sample output:</p>
  
  <pre><code>XXXX    X  
  X  X  
  xxxx  
  </code></pre>
  
  <p>desired output:</p>
  
  <pre><code>xxxx  
  x  x  
  xxxx    
  </code></pre>