
I have been caught with a practical exam to do the following:
I can be able to code step 1, but I can not the number 2, and 3,
Kindly assist.
SK.

hi friend try this code may this helpful for you.
public class CommandLineInput
{
public static String newline = System.getProperty("line.separator");
public static void main(String args[])
{
if(args.length <= 0)
{
System.out.println("Enter 100 words");
}
else if(args.length < 100)
{
System.out.println("Enter at least 100 words");
}
else
{
for(int i=0; i < args.length; i++)
{
int r = i%20;
if(r == 0)
{
String str = args[i];
System.out.print(args[i]+newline);
/*String[] tokens = str.split(" ");
for(int k=0; k<tokens.length; k++)
{
System.out.println(tokens[k]);
}
*/
}
else
{
System.out.print(args[i]);
}
}
}// else closed
}// main closed
}// class closed
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.