title: Help for creating a random String
body: <p>I need to create a random string which should be between the length of 6 to 10 but it sometimes generates only about the length of 3 to 5.
  Here's my code. Can anyone would be able to find out the problem? :(</p>
  
  <pre><code>            int lengthOfName = (int)(Math.random() * 4) + 6;
          String name = "";
          /* randomly choosing a name*/
          for (int j = 0; j &lt;= lengthOfName; j++) {
              int freq = (int)(Math.random() * 100) + 1;
              if(freq &lt;= 6){
                  name += "a";
              }if(freq == 7 &amp;&amp; freq == 8){
                  name += "b";
              }if(freq &gt;= 9 &amp;&amp; freq &lt;= 11){
                  name += "c";
              }if(freq &gt;= 12 &amp;&amp; freq &lt;= 15){
                  name += "d";
              }if(freq &gt;= 16 &amp;&amp; freq &lt;= 25){
                  name += "e";                        
              }if(freq == 26 &amp;&amp; freq == 27){
                  name += "f";
              }if(freq == 28 &amp;&amp; freq == 29){
                  name += "g";
              }if(freq &gt;= 30 &amp;&amp; freq &lt;= 33){
                  name += "h";
              }if(freq &gt;= 34 &amp;&amp; freq &lt;= 48){
                  name += "i";
              }if(freq == 49 &amp;&amp; freq == 50){
                  name += "j";
              }if(freq &gt;= 51 &amp;&amp; freq &lt;= 55){
                  name += "k";
              }if(freq &gt;= 56 &amp;&amp; freq &lt;= 60){
                  name += "l";
              }if(freq == 61 &amp;&amp; freq == 62){
                  name += "m";
              }if(freq &gt;= 63 &amp;&amp; freq &lt;= 70){
                  name += "n";
              }if(freq &gt;= 71 &amp;&amp; freq &lt;= 75){
                  name += "o";
              }if(freq == 76 &amp;&amp; freq == 77){
                  name += "p";
              }if(freq == 78){
                  name += "q";
              }if(freq &gt;= 79 &amp;&amp; freq &lt;= 84){
                  name += "r";
              }if(freq == 85 &amp;&amp; freq == 86){
                  name += "s";
              }if(freq == 87 &amp;&amp; freq == 88){
                  name += "t";
              }if(freq &gt;= 89 &amp;&amp; freq &lt;= 93){
                  name += "u";
              }if(freq == 94){
                  name += "v";
              }if(freq == 95 &amp;&amp; freq == 96){
                  name += "w";
              }if(freq == 97){
                  name += "x";
              }if(freq == 98 &amp;&amp; freq == 99){
                  name += "y";
              }if(freq == 100){
                  name += "z";
              }
          }
  </code></pre>