title: How to Repeat Characters of Strings using For Loops in Java
body: <p>I'm trying to figure out how to take a word as input from a user, then return that same string in a different format.</p>
  
  <p>For example, the input "dog" needs to show up as<br></p>
  
  <p>d<br>
  oo<br>
  ggg<br></p>
  
  <p>I can only use for-statements, not if-statements...and the program is supposed to only have 2 methods, the second one should return a value.</p>
  
  <p>I know how to take the input from the user, but I'm a bit lost on how to return a string that's formatted like the one above.</p>
  
  <p>This IS a homework question, so I'm not expecting anyone to just give me the answer. I'm really just stuck and have no idea what to do next. It's a basic java 1 class, so I can't use anything too complicated.</p>
  
  <p>Here's my unfinished code so far. I know it has a ton of problems >.&lt;</p>
  
  <pre><code>    import java.util.Scanner;
  
      public class Lab06Edit {
  
         public static void main(String[] args ) {
            Scanner keyboard = new Scanner(System.in);
            System.out.print("Enter a word:  ");
            String input = keyboard.next();
  
         wordAngle(input);
         System.out.print("" + wordAngle(input));
  
      }
  
         public static String wordAngle(String word) {
            String result = "";
            for (int i=0; i&lt;=input.length(); i++) {
               System.out.println(input.charAt(i)*i +"\n");
            return result;
            }     
         }
      }
  </code></pre>