I am trying to create a program that takes user input and makes a rectangle. The user input to numbers for length and width and another symbol or character to fill in the rectangle. That all works fine. My code works for creating a rectangle of any size but I need limit If the no of rows or cols is less than or equal to zero or more than 50 it needs to print out "error in input".

This is the code I have and I am currently trying to define it with if statement and it keeps print the state "error in input and the rectangle. Any help would be appreciated or another method to achieve the same thing.

```
import java.util.Scanner;

public class Rectangle
  {
    public static void main(String[] args)
  {
 int length;
 int width;
 String symbol;
 char symbolz;
 int xLength;
 int yWidth;

 Scanner input = new Scanner(System.in);         
 while(input.hasNext()){
    {  width = input.nextInt();
       length = input.nextInt();
       symbol = input.next();
       symbolz = symbol.charAt(0);

       if (length<=0||length>50||width<=0||width>50){
       }
        System.out.print("error in input");{

       {for (yWidth = 1; yWidth <= width; yWidth++){
        for (xLength = 1; xLength <= length; xLength++) {
            System.out.print(symbolz);
        }

        System.out.println(" ");
    }
    for(yWidth = 1; yWidth >= width; yWidth--){
        for (xLength = 1; xLength >= length; xLength--){
            System.out.print(symbolz);
        }

        System.out.println(" ");
                }
            }
            }
        }
    }
}}

```

Edited: switched to if statement but still am having trouble because it keeps inserting "error in user input" in all things typed and also prints the rectangle when it isn't supposed to. 

So far I have tried to get the If statement to work and it keeps doing the same thing where it keeps print "error in user input" on inputs that are out side the range but it also prints the rectangle after which it shouldn't do. Any guidance?