Question: Test 1 Write a Java program in a file called Hine.java that prompts (Optional bonus question) (asks) the user for a number of rows. Next

 Test 1 Write a Java program in a file called Hine.java

Test 1 Write a Java program in a file called Hine.java that prompts (Optional bonus question) (asks) the user for a number of rows. Next the program prompts (asks) the user for a text string. The program then creates a 2D array of type char and displays the text string across the top row. The program then goes through the array and moves each character a randonm number of rows. Note that a character always stays within the array. That is, if the new row number is outside the array bounds then the new row number is "wrapped around" so that the row index is always within the array. After moving the characters, the array is displayed. Repeat this for at least the number of rows. You can make the program run more times than this if you wish. 9. Recall that Math. random) returns a number between 0.0 and 0.99. You need to translate this to an integer and ensure that the row index stays within the array, or use the Random class as we did in Assignment B and use nextint ( ) . An example run of the program is shown below (user input is in bold) Enter number of rows>6 Enter text >> Moving Text Moving Text M v Mvnx in T t ov g NOTBEMOVE THIS PAPER FROM THE LABORATORY

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!