Write a class named Java1306CMIS141C801 that performs the following actions.
Prompt the user for an int between lower and upper boundary. Reuse the validateInput() method from project 2 to validate if the input is in bounds. If it is not, print an error that the given input is not greater than the lower bound and not less than the upper bound, then end the program.
If input is in bounds, prepare an array of type String of that length. Loop the length of the array. For each array element, make a random number from 0 to 9. Reuse the convertInput() method from project 2 and put into each array element the String value that corresponds to the random number.
Create a second loop that prints the contents of the array as array index followed by the array index contents. Use the escape character for the tab stop to line up the output.
Your upper and lower boundaries could be constants. Use 1 as lower and 20 as upper boundaries.
Your deliverables:
Java1306CMIS141C801Project3.java
Screen shot of your program, demonstrating both a failure case and a successful run.
Here is a sample run. Your output could be similar to this. Obviously, the random numbers will be different for every run.
Volume in drive C is OS
Volume Serial Number is A426-EE6D
Directory of C:\Users\andy\java\141\p3
12/26/2013 12:37 PM
.
12/26/2013 12:37 PM
..
12/26/2013 12:37 PM 2,242 Java1302CMIS141C801Project.class
12/26/2013 12:37 PM 1,753 Java1302CMIS141C801Project.java
2 File(s) 3,995 bytes
2 Dir(s) 118,631,022,592 bytes free
Enter size of the array, between 1 and 20. -3
Invalid input. -3 is not >= 1 and <= 20.
Enter size of the array, between 1 and 20. 2332
Invalid input. 2332 is not >= 1 and <= 20.
Enter size of the array, between 1 and 20. 5
The contents of the 5 element array:
0. zero
1. zero
2. six
3. three
4. two
End of array contents.
Enter size of the array, between 1 and 20. 5
The contents of the 5 element array:
0. one
1. nine
2. one
3. one
4. seven
End of array contents.