how to code a for loop using a 2 dimensional array -
I am just learning Java and participating in a problem while completing an assignment. I need to use for the loop, but I have uncertainty about proper coding. I was able to compile my code to get the output for the first challenge, but I am unable to do this for the remaining challenges. Any tips / tips are greatly appreciated
/ Your trainer is in the bind, instead of his work, a new // technology project has been established, which will require remote access verification. // In addition to his username and password, he will have a "challenge" // Every sign-on will require that challenge that it depends on a number or / or letter that asks the security application. // But your instructor is lazy he wants an application that will tell him what he is / without telling them that without the proper numbers, what should they do to do them // should be shown every time. He understands that this film will help // remote hackers, but he does not want to be trapped in carrying around a piece of paper at all times. // Write your instructor a program, which asked him for three characters. The matrix to use is: // ABCDEFGHI1 // 1 3N1M4 Rx5FN / 2NVT5KKFM3P / 3WKY4VT4VTF3/4339V4YRTNN/53 1 1 3 2 9 XPNP / A1: B2: A Challenge 3V1 will be generated. A challenge of G4: D2: J3RR 3 3/1 will generate 1. 1. Input / ---- make a scanner class 2. 2. Input String input = Ask for "A1" ; // 3. Take the character before the challenge / (like "D2" is "D" and its corresponding integer array value) int i1 = Util.findFirstValue (input); Println (i1); // 4. Take the second character from the challenge (like "D2" will be // "2") and its corresponding int array value // signal: always be one less than the value entered. Int i2 = Util.findSecondValue (Input); Println (i2); // 5. In order to obtain the desired value System.out.println (Util.findArrayValue (i1, i2)), query the array with the challenge values; // 6. Display price 7. 7. Repeat steps 2 to 6} {for (int row = 1; row & lt; 9; line ++) {for (int column = 2; column & lt; 5 To make it looping through the column + multi-dimensional arrays, it should be preferred.
For
(int i = 0; i & lt; multarray [i]. Length; i ++) {multirayare [i] [k]; // do something with it!} You can find out about iterating the multi-dimension array in Java.
Comments
Post a Comment