You are not logged in.
I need helping searching and replacing trought a two-dimensional array
basically I have:
String array [][] = {"1", "A", "B", "C", },
{"2", "A", "B", "C", },
{"3", "A", "B", "C", },
{"4", "A", "B", "C", },
{"5", "A", "B", "C",} };
Ask the user to input two character that are in the array
if the user input (e.g., "1A") I print again the array but replacing A with '*' or until the user quit. Prfer using loop because the array is big
thanks
Offline
I suggest a "two-nested-loops" approach if you want to brute-force this (which you may have to if your array is assumed to be filled with "random" data). I'm going to avoid going into detailed code examples because this sounds suspiciously like homework, but I'll lay down some pseudocode:
for i in 1 --> max_x
for j in 1 --> max_y
check array[i][j], replace if necessary
Offline