Matrik In Java

i ever get that’s matrik in sma , but now i am forget for that.
after i see again how to make matrik , i direct to make a program
this program have difficult for me . when i analysis about this matrik
i am confuse how to make that then someday later, searching in google
eh .. i get that source code but i can’t understand about that code
how to work that’s code . then i see and i try to understand about code
finally i get that analys.
like this

package Latihan;
import javax.swing.JOptionPane;
public class Matrik3X3 {
public static void main(String[] args) {
int a[][] = new int[3][3]; // this code for declaration matrik 3x3 in line a and b yang k-1
 int b[][] = new int[3][3];//this code for declaration matrik 3x3 in line a and b yang k-2
 int hasil[][] = new int[a.length][b[0].length]; // declaration for cross a x b

for (int i = 0; i < a.length; i++) {// for input this line a k-1
 for (int j = 0; j < a[0].length; j++) {for input this colom b k-1
 a[i][j] = Integer.parseInt(JOptionPane.showInputDialog(" yang ke 1 matrik a pada baris" + i + "matrik b pada kolom" + j));// this is input for matrik one is finish.

}
 }

for (int i = 0; i < b.length; i++) {//for input this line a k-2
 for (int j = 0; j < b[0].length; j++) {// for input this colom b k-2
 b[i][j] = Integer.parseInt(JOptionPane.showInputDialog(" yang ke 2 matrik a pada baris" + i + "matrik b pada kolom" + j));//this is input for matrik two is finish.

}
 }

for (int i = 0; i < b[0].length; i++) { //interation for matrik k-2
 for (int j = 0; j < a.length; j++) {// interation for matrik k-1
for (int k = 0; k < a[0].length; k++) {
 hasil[i][j] = hasil[i][j] + (a[i][k] * b[k][j]);// cross matrik a x b
 }
 }
 }

for (int i = 0; i < hasil.length; i++) { //finnaly line
 for (int j = 0; j < hasil[0].length; j++) { //finnaly colom

System.out.print(hasil[i][j] + " "); // finnaly show like this
 }
 System.out.println(" ");
 }
 }

Diterbitkan oleh

Taken

i need somebody for help me to make anything what i need

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s