Please write in JAVA
In the Print class, implement a static method named printNumbers that will print out numbers in brackets, formatted as [1][2][3], and so on. The method should accept two integer parameters: howMany and lineLength. The signature of the method should be “public static void printNumbers(int howMany, int lineLength)”. The method should print numbers from 1 to howMany in the previous format, but it should not output more than lineLength characters on any one line. It should not start a [ unless it can fit the corresponding ] in the same line. Some sample inputs and expected output is shown below.
Extracted text: howMany lineLength Output 14 12 [1][2][3][4] 4 10 [1][2][3] [4] [1] [2] [3] 3 2 Error! lineLength must at least be 3. LO 3.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here