title: Printing A Diamond Shape In Java, Based On User Input
body: <p>I have a problem with a program I am trying to write. A user inputs a positive odd integer, otherwise the program prompts the user until they do. When they do, the program prints a diamond shape corresponding to the user input. </p>
  
  <p>I have this piece so far that prints the left hand diagonal of such a figure, but cannot figure out how to print the rest of it. Here is the code:</p>
  
  <pre><code>import java.util.Scanner; 
  public class DrawingProgram {
  
      public static void main(String[] args) {
          Scanner keyboard = new Scanner(System.in);
          System.out.println("Welcome to the drawing program:");
          System.out.println("Please Input a Positive Odd Integer:");
          char userAnswer; 
          int userInput;
          userInput = keyboard.nextInt(); 
          if (userInput%2 == 0){
              System.out.println("That is not a Positive Odd Integer!");
          }
  
          else if (userInput &lt; 0){
              System.out.println("That is not a Positive Odd Integer");
  
          }
  
          else if (userInput%2 == 1){
                  for (int row = 1; row&lt;= userInput; row++){
                      for (int col = 1; col&lt;= userInput; col++ ){
                          if (row+col==userInput-1 )
  
                              System.out.print( "*");
                          else
                              System.out.print( " ");
              }
                  System.out.print("\n");
          }
  
      }
  
      }
  }
  </code></pre>