Senin, 14 November 2011

Program Matrik ordo 4x4

Operasi array matriks

import javax.swing.JOptionPane;

/**
 *
 * @author Zed
 */
public class Operasi_Matriks {
    public static void main(String[] args) {

        System.out.println("Operasi Matriks");
        int row = Integer.parseInt(JOptionPane.showInputDialog(null,"Masukkan Jumlah Baris: "));
        int col = Integer.parseInt(JOptionPane.showInputDialog(null,"Masukkan Jumlah Kolom: "));
        double A[][] = new double[row][col];
        double B[][] = new double[row][col];
        double C[][] = new double[row][col];
        double D[][] = new double[row][col];
        int i,j,k;

        System.out.println("\nMatriks A");
        for(i=0;i
            System.out.print("| ");
            for(j=0;j
                A[i][j] = Double.parseDouble(JOptionPane.showInputDialog(null,"Masukkan Matriks A ["+(i+1)+","+(j+1)+"]"));
                System.out.print(" "+A[i][j]+" ");
            }
            System.out.println(" |");
        }

        System.out.println("\nMatriks B");
        for(i=0;i
            System.out.print("| ");
            for(j=0;j
                B[i][j] = Double.parseDouble(JOptionPane.showInputDialog(null,"Masukkan Matriks B ["+(i+1)+","+(j+1)+"]"));
                System.out.print(" "+B[i][j]+" ");
            }
            System.out.println(" |");
        }

        System.out.println("\nPenjumlahan Matriks");
        System.out.println("Matriks A + B =");
        for(i=0;i
            System.out.print(" | ");
            for(j=0;j
                for(k=0;k
                C[i][j] = (A[i][j]+B[i][j]);
                }
            System.out.print(" "+C[i][j]+" ");
            }
            System.out.println(" | ");
        }

        System.out.println("\nPengurangan Matriks");
        System.out.println("Matriks A - B =");
        for(i=0;i
            System.out.print(" | ");
            for(j=0;j
                for(k=0;k
                C[i][j] = (A[i][j]-B[i][j]);
                }
            System.out.print(" "+C[i][j]+" ");
            }
            System.out.println(" | ");
        }

        System.out.println("\nPerkalian Matriks");
        System.out.println("Matriks A x B =");
        for(i=0;i
            System.out.print(" | ");
            for(j=0;j
                for(k=0;k
                D[i][j] = D[i][j]+(A[i][k] * B[k][j]);
                }
            System.out.print(" "+D[i][j]+" ");
            }
            System.out.println(" | ");
        }

    }
}

Jumat, 04 November 2011

Flowchart + Program Luas Persegi Panjang




package persegi_panjang;

/**
 *
 */
public class Main {

    /**
     * @param args the command line arguments
     */

 public static void main(String[] args) {
        double p,l,L;

        p = 20;
        l = 15;

        L = p*l;

        System.out.println("Luas persegi panjang" +L);

}

}

Flowchart Mereparasi Motor

Flowchart Menggoreng Telur & Memindahkan Chanel TV

Rabu, 02 November 2011

run hasil bilangan prima



  • Run Hasil


program bilangan prima



  • Program

flowchart bilangan prima


  • Flowchart

program bilangan ganjil genap

  • Program

flowchart bilangan ganjil genap


  • Flowchart

run hasil nilai


  • Run Hasil

program nilai

  • program

package hasil_angka;

/**
 *
 * @author YUDHA
 */
public class LATIHAN {

     */
    public static void main(String[] args) {
         double nilai;

        nilai = 71;

        if (nilai >= 0 && nilai <=40) {
            System.out.println("E");
        }
        else if (nilai >= 41 && nilai <=50) {
            System.out.println("D");
        }
        else if (nilai >= 51 && nilai <=60) {
            System.out.println("C");
        }
        else if (nilai >= 61 && nilai <=70) {
            System.out.println("B");
        }
        else if (nilai >= 71 && nilai <=80) {
            System.out.println("A");
        }
        else if (nilai >= 81 && nilai <=100) {
            System.out.println("input salah");
        }{

        }
{

        }

    }

}

flowchart nilai





  • program mendapat beasiswa


    • Program

    Flowchart Proses Mendapat Beasiswa