Question: Java Make a Packman program. Follow the instructions below. Declare a two-dimensional char array with 5 rows and 5 columns and initialize every element with
Java


Make a Packman program. Follow the instructions below. Declare a two-dimensional char array with 5 rows and 5 columns and initialize every element with the * symbol using a nested for loop. Create two int variables x and y to indicate the current position and use the @ symbol as the current position in the program. Let x represent the row index and y represent the column index. Let x be 2 and y be 0 at the beginning- Use a loop to move around until there are less than 50% of remaining. Repeat the following process in the loop until the conditional expression is satisfied: - Display the current state of the two-dimensional char array using a nested for loop. - Move one space at a time. Move up, down, left, or right randomly. Do not move diagonal, teleport, or reach outside of the boundaries. - Update the previous location with a space. - Update the current position with a @ symbol
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
