title: How to print out the output vertically
body: <p>Basically, the user enters student grades and the program will display and arrange them into sections (0-29 marks, 30-39 marks, 40-69 marks and 70-100 marks). If the user enters anything higher than 100 then the program terminates and outputs the results. </p>
  
  <p>I'm just having trouble printing out the output vertically. </p>
  
  <pre><code>public static void main(String[] args) 
  {
      Scanner input = new Scanner(System.in);
      System.out.println("Type in the students marks. Type above 100 to show output.");
  
      int marks;
      int starsfrom0to29 = 0;
      int starsfrom30to39 = 0;
      int starsfrom40to69 = 0;
      int starsfrom70to100 = 0;
      int counter = 0;
  
  
      marks = input.nextInt();
  
  
      while (marks &lt; 100) {
  
          //PUTTING MARKS INTO CATEGOERY
          if ((marks &gt;= 0) &amp;&amp; (marks &lt;= 29)) {
              starsfrom0to29++;
          }
  
          if ((marks &gt;= 30) &amp;&amp; (marks &lt;= 39)) {
              starsfrom30to39++;
          }
  
          if ((marks &gt;= 40) &amp;&amp; (marks &lt;= 69)) {
              starsfrom40to69++;
          }
  
          if ((marks &gt;= 70) &amp;&amp; (marks &lt;= 100)) {
              starsfrom70to100++;
          }
  
          if (marks &lt; 100) {
              counter++;
          }
  
         marks = input.nextInt();
  
      }
      //PRINTING OUT NUMBER OF STARS
      System.out.println();
      System.out.print("0-29    ");
      for (int x = 0; x &lt; starsfrom0to29; x++) {
          System.out.print("*");
      }
      System.out.println();
  
      System.out.print("30-39   ");
      for (int x = 0; x &lt; starsfrom30to39; x++) {
          System.out.print("*");
      }
      System.out.println();
  
      System.out.print("40-69   ");
      for (int x = 0; x &lt; starsfrom40to69; x++) {
          System.out.print("*");
      }
      System.out.println();
  
      System.out.print("70-100  ");
      for (int x = 0; x &lt; starsfrom70to100; x++) {
          System.out.print("*");
      }
      System.out.println();
  
      System.out.println();
  }
  </code></pre>
  
  <p>This prints it out horizontally. E.g: If I typed in the numbers: 23,65,77,87,101 it would display:<br/>
  0-29    *  <br/>
  30-39     <br/>
  40-69   *  <br/>
  70-100  **  <br/></p>
  
  <p>However, I need to find out how to print the output vertically. Basically the stars (asterisks) should be in a vertical line and are below the headlines.  </p>