Write a method starString that accepts an integer parameter
Solution
Note :I couldnt able to see the symbols .I think those are astrisks.That why I used the astrisk symbol.If the symbols are not correct just comment the symbols.So that I will change.
____________________
AsteriskMarks.java
import java.util.Scanner;
public class AsteriskMarks {
   public static void main(String[] args) {
        //Declaring variables
        int num;
       
        //Scanner class object is sued to read the inputs entered by the user
        Scanner sc = new Scanner(System.in);
       
        /* This loop continue to iterate until
        * the user enters a positive number
        */
        while (true) {
           
            //Getting the Integer Entered by the user
            System.out.print(\"Enter an Integer :\");
            num = sc.nextInt();
            try {
                /* If the user enters a number which is less than zero
                * Throw exception
                */
                if (num < 0) {
                    throw new IllegalArgumentException(\":: Number Must be Greater than Zero ::\");
                }
                else
                {
                    //Calling the method by passing the number as input
                    starString(num);
                    break;
                }
            } catch (IllegalArgumentException IAE) {
                System.out.println(IAE);
                continue;
            }
        }
    }
   /* This method will display the Astrisk
    *based on the User entered number
    */
    private static void starString(int num) {
        for(int i=0;i<Math.pow(2,num);i++)
        {
            System.out.print(\"*\");
        }
       
    }
}
______________________
Output:
Enter an Integer :-5
 java.lang.IllegalArgumentException: :: Number Must be Greater than Zero ::
 Enter an Integer :5
 ********************************
_______Thank You


