adding a control structure
<p>the code below convert a decimal number to octal number. what i need is to have it to be able to display these message when the input is invalid and repeat the input process until a valid input in entered</p>

<p>"Enter a decimal number: -1</p>

<p>Input should not have any negative sign! </p>

<p>Enter a decimal number: -a </p>

<p>Input should not have any negative sign! </p>

<p>Input should not contain letters! </p>

<p>Enter a decimal number: -1.1 </p>

<p>Input should not have any decimal point! </p>

<p>Input should not have any negative sign! </p>

<p>Enter a decimal number: -1.a </p>

<p>Input should not have any decimal point! </p>

<p>Input should not have any negative sign! </p>

<p>Input should not contain letters! </p>

<p>Enter a decimal number: 15 decimal 15 = octal 17"</p>

<p>import java.util.Scanner;</p>

<p>public class apple</p>

<p>{ </p>

<pre><code>public static void main(String args[])
{
    Scanner sc = new Scanner( System.in );

    System.out.print("Enter a decimal number: ");
    int num =sc.nextInt();


    int rem;
    String str="";

    int num1 = num;
    while(num&gt;0)
    { 
        rem=num%8;
        num=num/8;

        str =rem+str;
    }
    System.out.println("decimal " + num1 + " = octal " + str);
}
</code></pre>

<p>}</p>

<p>thanks in advance.</p>