Selasa, 26 April 2016

TUGAS 1 SISTEM BERKAS ORGANISASI BERKAS PADA MAGNETIC TAPE


TUGAS 1 SISTEM BERKAS
ORGANISASI BERKAS PADA MAGNETIC TAPE


Disusun oleh :



                                          Nama  : Muanar Gadafi Barek
                                          Nim     : 121051027


JURUSAN TEKNIK INFORMATIKA
FAKULTAS TEKNIK INDUSTRI
INSTITUT SAINS & TEKNOLOGI AKPRIND
2016





Soal/Permasalahan :

Buatlah suatu aplikasi untuk mancari panjang pita, lama akses, dan transfer rate pada Magnetic Tape. Dengan menggunakan 2 metode yaitu metode blocking dan tanpa blocking. Dengan Inputan :
  • Jumlah Record
  • Panjang Record
  • IRG
  • IBG
  • Blocking Factor
  • Data Dencity
  • Laju Pita

Algoritma :

  • Mulai Program
  • Memilih Metode (Blocking atau Tanpa Blocking)
  • Mengisi inputan (Jumlah Record, Panjang Record, IRG, IBG, Blocking Factor, Data Dencity, Laju Pita)
  • Mulai Perhitungan
  • Tampilkan Hasil
  • Keluar (Selesai)

Source Code :

public class tugas1_SB extends javax.swing.JFrame {
int brs=0;
    public tugas1_SB() {
        initComponents();
    }
    @SuppressWarnings("unchecked")
private void hapusActionPerformed(java.awt.event.ActionEvent evt) {                                      
        brs += 1;
        tf1.setText("");
        tf2.setText("");
        tf3.setText("");
        tf4.setText("");
        tf5.setText("");
        tf6.setText("");
        tf7.setText("");
        pp.setText("");
        la.setText("");
        tr.setText("");
}                                     
private void hitungActionPerformed(java.awt.event.ActionEvent evt) {                                      
        String jml_rec = tf1.getText();
        String pjg_rec = tf2.getText();
        String irg = tf3.getText();
        String ibg = tf4.getText();
        String bf = tf5.getText();
        String dd = tf6.getText();
        String lpita = tf7.getText();
        int jr = Integer.parseInt(jml_rec);
        float pr = Float.parseFloat(pjg_rec);
        float d = Float.parseFloat(dd);
        float lp = Float.parseFloat(lpita);
        if (bt1.isSelected()) {
            float ib = Float.parseFloat(ibg);
            int bfac = Integer.parseInt(bf);
            float pjg_pita = (jr / bfac) * ((bfac * pr / d) + ib);
            String pp1 = Float.toString(pjg_pita);
            pp.setText(pp1);
            float lakses = pjg_pita / lp;
            String la1 = Float.toString(lakses);
            la.setText(la1);
            float t_rate = (d * pr) / lakses;
            String tr1 = Float.toString(t_rate);
            tr.setText(tr1);
        }
        if (bt2.isSelected()) {
            float ir = Float.parseFloat(irg);
            float pjg_pita = jr * ((pr / d) + ir);
            String pp1 = Float.toString(pjg_pita);
            pp.setText(pp1);
            float lakses = pjg_pita / lp;
            String la1 = Float.toString(lakses);
            la.setText(la1);
            float t_rate = (d * pr) / lakses;
            String tr1 = Float.toString(t_rate);
            tr.setText(tr1);
        }

        jTable1.setValueAt(tf1.getText(), brs, 0);
        jTable1.setValueAt(tf2.getText(), brs, 1);
        jTable1.setValueAt(tf3.getText(), brs, 2);
        jTable1.setValueAt(tf4.getText(), brs, 3);
        jTable1.setValueAt(tf5.getText(), brs, 4);
        jTable1.setValueAt(tf6.getText(), brs, 5);
        jTable1.setValueAt(tf7.getText(), brs, 6);
        jTable1.setValueAt(pp.getText(), brs, 7);
        jTable1.setValueAt(la.getText(), brs, 8);
        jTable1.setValueAt(tr.getText(), brs, 9);
}                      
public static void main(String args[]) {
    
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new tugas1_SB().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify                    
    private javax.swing.JRadioButton bt1;
    private javax.swing.JRadioButton bt2;
    private javax.swing.JButton hapus;
    private javax.swing.JButton hitung;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField la;
    private javax.swing.JTextField pp;
    private javax.swing.JTextField tf1;
    private javax.swing.JTextField tf2;
    private javax.swing.JTextField tf3;
    private javax.swing.JTextField tf4;
    private javax.swing.JTextField tf5;
    private javax.swing.JTextField tf6;
    private javax.swing.JTextField tf7;
    private javax.swing.JTextField tr;
    // End of variables declaration                  
}


Hasil Running :


Menggunakan Metode Blocking :



Menggunakan Metode Tanpa Blocking :




0 komentar:

Posting Komentar