I made this blog as a means of communication to friends majoring in Telecommunications, may be useful, :)
Kamis, 23 Juni 2011
Jumat, 17 Juni 2011
Kisi-Kisi Uas Prak.PBO
MATRIKS PERKALIAN
package lat_matrikskali_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
// TODO code application logic here
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS MATRIKS 1 = ");
int JmlBrs1 = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 1 = ");
int JmlKlm1 = Integer.parseInt(entry.readLine());
int JmlBrs2 = JmlKlm1;
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 2 = ");
int JmlKlm2 = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs1][JmlKlm1];
int [][] MatriksB = new int[JmlBrs2][JmlKlm2];
int [][] MatriksC = new int[JmlBrs1][JmlKlm2];
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm1; j++)
MatriksA[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs2; i++)
for (int j=0; j<JmlKlm2; j++)
MatriksB[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm2; j++)
{
MatriksC[i][j] = 0;
for (int k=0; k<JmlKlm1; k++)
MatriksC[i][j] += MatriksA[i][k] * MatriksB[k][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm1; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs2; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PERKALIAN A x B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e)
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
MATRIKS PENJUMLAHAN
package lat_matrikstambah_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS = ");
int JmlBrs = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM = ");
int JmlKlm = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs][JmlKlm];
int [][] MatriksB = new int[JmlBrs][JmlKlm];
int [][] MatriksC = new int[JmlBrs][JmlKlm];
for (int i=0; i<JmlBrs; i++)
for (int j=0; j<JmlKlm; j++)
{
MatriksA[i][j] = (int)(Math.random()*100);
MatriksB[i][j] = (int)(Math.random()*100);
MatriksC[i][j] = MatriksA[i][j] + MatriksB[i][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PENJUMLAHAN A + B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e )
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
PENJUMLAHAN
package lat_1c;
/* @author SITI MADINAH */
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
String a, b;
int angka1, angka2, tambah;
a = JOptionPane.showInputDialog( "Angka 1 = " );
b = JOptionPane.showInputDialog( "Angka 2 = " );
angka1 = Integer.parseInt( a );
angka2 = Integer.parseInt( b );
tambah = angka1 + angka2;
JOptionPane.showMessageDialog( null, +angka1+ "+" +angka2+ "=" + tambah, "HASIL", JOptionPane.WARNING_MESSAGE );
System.exit( 0 );
}
}
Label:
Kisi-kisi UAS praktek PBO
Kisi-Kisi Uas Prak.PBO
MATRIKS PERKALIAN
package lat_matrikskali_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
// TODO code application logic here
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS MATRIKS 1 = ");
int JmlBrs1 = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 1 = ");
int JmlKlm1 = Integer.parseInt(entry.readLine());
int JmlBrs2 = JmlKlm1;
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 2 = ");
int JmlKlm2 = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs1][JmlKlm1];
int [][] MatriksB = new int[JmlBrs2][JmlKlm2];
int [][] MatriksC = new int[JmlBrs1][JmlKlm2];
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm1; j++)
MatriksA[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs2; i++)
for (int j=0; j<JmlKlm2; j++)
MatriksB[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm2; j++)
{
MatriksC[i][j] = 0;
for (int k=0; k<JmlKlm1; k++)
MatriksC[i][j] += MatriksA[i][k] * MatriksB[k][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm1; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs2; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PERKALIAN A x B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e)
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
MATRIKS PENJUMLAHAN
package lat_matrikstambah_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS = ");
int JmlBrs = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM = ");
int JmlKlm = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs][JmlKlm];
int [][] MatriksB = new int[JmlBrs][JmlKlm];
int [][] MatriksC = new int[JmlBrs][JmlKlm];
for (int i=0; i<JmlBrs; i++)
for (int j=0; j<JmlKlm; j++)
{
MatriksA[i][j] = (int)(Math.random()*100);
MatriksB[i][j] = (int)(Math.random()*100);
MatriksC[i][j] = MatriksA[i][j] + MatriksB[i][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PENJUMLAHAN A + B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e )
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
PENJUMLAHAN
package lat_1c;
/* @author SITI MADINAH */
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
String a, b;
int angka1, angka2, tambah;
a = JOptionPane.showInputDialog( "Angka 1 = " );
b = JOptionPane.showInputDialog( "Angka 2 = " );
angka1 = Integer.parseInt( a );
angka2 = Integer.parseInt( b );
tambah = angka1 + angka2;
JOptionPane.showMessageDialog( null, +angka1+ "+" +angka2+ "=" + tambah, "HASIL", JOptionPane.WARNING_MESSAGE );
System.exit( 0 );
}
}
Label:
Kisi-kisi UAS praktek PBO
Kisi-Kisi Uas Prak.PBO
MATRIKS PERKALIAN
package lat_matrikskali_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
// TODO code application logic here
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS MATRIKS 1 = ");
int JmlBrs1 = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 1 = ");
int JmlKlm1 = Integer.parseInt(entry.readLine());
int JmlBrs2 = JmlKlm1;
System.out.print(" INPUT JUMLAH KOLOM MATRIKS 2 = ");
int JmlKlm2 = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs1][JmlKlm1];
int [][] MatriksB = new int[JmlBrs2][JmlKlm2];
int [][] MatriksC = new int[JmlBrs1][JmlKlm2];
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm1; j++)
MatriksA[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs2; i++)
for (int j=0; j<JmlKlm2; j++)
MatriksB[i][j] = (int)(Math.random()*100);
for (int i=0; i<JmlBrs1; i++)
for (int j=0; j<JmlKlm2; j++)
{
MatriksC[i][j] = 0;
for (int k=0; k<JmlKlm1; k++)
MatriksC[i][j] += MatriksA[i][k] * MatriksB[k][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm1; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs2; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PERKALIAN A x B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs1; i++)
{
for (int j=0; j<JmlKlm2; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e)
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
MATRIKS PENJUMLAHAN
package lat_matrikstambah_sitimadinah;
/* @author SITI MADINAH */
import java.io.*;
public class Main {
/* @param args the command line arguments */
public static void main(String[] args) {
DataInputStream entry = new DataInputStream(System.in);
try
{
System.out.print(" INPUT JUMLAH BARIS = ");
int JmlBrs = Integer.parseInt(entry.readLine());
System.out.print(" INPUT JUMLAH KOLOM = ");
int JmlKlm = Integer.parseInt(entry.readLine());
int [][] MatriksA = new int[JmlBrs][JmlKlm];
int [][] MatriksB = new int[JmlBrs][JmlKlm];
int [][] MatriksC = new int[JmlBrs][JmlKlm];
for (int i=0; i<JmlBrs; i++)
for (int j=0; j<JmlKlm; j++)
{
MatriksA[i][j] = (int)(Math.random()*100);
MatriksB[i][j] = (int)(Math.random()*100);
MatriksC[i][j] = MatriksA[i][j] + MatriksB[i][j];
}
System.out.println(" \n DATA MATRIKS A = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksA[i][j] + " ");
System.out.println();
}
System.out.println(" \n DATA MATRIKS B = ");
System.out.println("______________________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksB[i][j] + " ");
System.out.println();
}
System.out.println(" \n MATRIKS " + " PENJUMLAHAN A + B = ");
System.out.println("_________________" + "_______________");
for (int i=0; i<JmlBrs; i++)
{
for (int j=0; j<JmlKlm; j++)
System.out.print(MatriksC[i][j] + " ");
System.out.println();
}
}
catch (Exception e )
{
System.out.println(" SALAH ENTRY DATA ");
}
}
}
PENJUMLAHAN
package lat_1c;
/* @author SITI MADINAH */
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
String a, b;
int angka1, angka2, tambah;
a = JOptionPane.showInputDialog( "Angka 1 = " );
b = JOptionPane.showInputDialog( "Angka 2 = " );
angka1 = Integer.parseInt( a );
angka2 = Integer.parseInt( b );
tambah = angka1 + angka2;
JOptionPane.showMessageDialog( null, +angka1+ "+" +angka2+ "=" + tambah, "HASIL", JOptionPane.WARNING_MESSAGE );
System.exit( 0 );
}
}
Label:
Kisi-kisi UAS praktek PBO
Langganan:
Postingan (Atom)