Stinkone

My WordPress Blog

Stinkone

TUGAS 1 SISTEM BERKAS

Uncategorized

TUGAS 01
SISTEM BERKAS

Disusun Oleh:

Nama : Thoyiban Adi Putra
Nim :1151051084

JURUSAN TEKNIK INFORMATIKA
FAKULTAS TEKNOLOGI INDUSTRI
INSTITUT SAINS & TEKNOLOGI AKPRIND
YOGYAKARTA
2017

SOAL / PERMASALAHAN

Dengan inputan sebagai berikut :
1. Jumlah record
2. Panjang record
3. IRG/IBG
4. Blocking Factor
5. Data dencity
6. Laju pita
Buatlah program untuk menghitung :
1. Panjang pita
2. Lama akses
3. Transfer rate
Program menyediakan pilihan metode tanpa blocking dan blocking
Bahasa pemrograman yang saya pakai untuk membuat program ini adalah bahasa java.
ALGORITMA

  • Memilih apakah akan menghitung dengan metode tanpa blocking atau blocking
    Jika memilih tanpa blocking maka baca jumlah record (jml_rec), panjang record (pjg_rec), irg, data dencity (dd) dan laju pita(laju_pita).
    1. Hitung panjang pita
    pjg_pita = ((pjg_rec/dd)+irg)*jml_rec
    2. Hitung lama akses
    lama_akses = pjg_pita/laju_pita
    3. Hitung transer rate
    tr = (pjg_rec*jml_rec)/lama_akses
  • Jika memilih dengan metode blocking maka baca jumlah record (jml_rec), panjang record (pjg_rec), ibg, data dencity (dd), laju pita(laju_pita) dan blocking factor (bf).
    1. Hitung panjang pita
    pjg_pita = (jml_rec/bf)*((bf*pjg_rec/dd)+ibg)
    2. Hitung lama akses
    lama_akses = pjg_pita/laju_pita
    3. Hitung transer rate
    tr = (pjg_rec*jml_rec)/lama_akses
  • SOURCE CODE DENGAN JAVA NETBEANS

public class tampilan extends javax.swing.JFrame {
public double j_rec;
public double p_rec;
public double irgg;
public double ibgg;
public double bf;
public double dd;
public double lp;
public double pjg_pit,pjg_rate;
public double pjg_akses;
public tampilan() {
initComponents();
}

@SuppressWarnings(“unchecked”)
// <editor-fold defaultstate=”collapsed” desc=”Generated Code”>
private void initComponents() {

buttonGroup1 = new javax.swing.ButtonGroup();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jml_rec = new javax.swing.JTextField();
pjg_rec = new javax.swing.JTextField();
irb = new javax.swing.JTextField();
ibg = new javax.swing.JTextField();
blocking = new javax.swing.JTextField();
data_den = new javax.swing.JTextField();
laju_pita = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
pjg_pita = new javax.swing.JTextField();
lama = new javax.swing.JTextField();
tr = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
block = new javax.swing.JRadioButton();
nonblok = new javax.swing.JRadioButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
jLabel24 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setText(“Jumlah Record”);

jLabel2.setText(“Panjang Record”);

jLabel3.setText(“Laju Pita”);

jLabel4.setText(“IRB”);

jLabel5.setText(“Blocking Factor”);

jLabel6.setText(“IBG”);

jLabel7.setText(“Data Dencity”);

jml_rec.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jml_recActionPerformed(evt);
}
});

blocking.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
blockingActionPerformed(evt);
}
});

jLabel8.setText(“Record”);

jLabel9.setText(“Byte”);

jLabel10.setText(“Inch”);

jLabel11.setText(“inch”);

jLabel12.setText(“bpl”);

jLabel13.setText(“Inch/detik”);

jLabel14.setText(“HASIL PERHITUNGAN”);

jLabel15.setText(“Panjang Pita”);

jLabel16.setText(“Lama Akses”);

jLabel17.setText(“Transfer RAte”);

lama.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lamaActionPerformed(evt);
}
});

tr.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
trActionPerformed(evt);
}
});

jLabel18.setText(“Inch”);

jLabel19.setText(“Detik”);

jLabel20.setText(“Byte/detik”);

buttonGroup1.add(block);
block.setText(“Blocking”);
block.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
blockActionPerformed(evt);
}
});

buttonGroup1.add(nonblok);
nonblok.setText(“Non Blocking”);
nonblok.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
nonblokActionPerformed(evt);
}
});

jButton2.setText(“RESET”);
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jButton3.setText(“HITUNG”);
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton4.setBackground(new java.awt.Color(153, 255, 255));
jButton4.setText(“EXIT”);
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});

jLabel21.setBackground(new java.awt.Color(255, 51, 51));
jLabel21.setFont(new java.awt.Font(“Trebuchet MS”, 3, 24)); // NOI18N
jLabel21.setForeground(new java.awt.Color(204, 0, 0));
jLabel21.setText(“SAVAGE”);

jLabel22.setFont(new java.awt.Font(“Rockwell Condensed”, 3, 14)); // NOI18N
jLabel22.setText(“Thoyiban Adi Putra”);

jLabel23.setFont(new java.awt.Font(“Rockwell Condensed”, 3, 14)); // NOI18N
jLabel23.setText(“151051084”);

jLabel24.setText(“Inch”);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
);
}// </editor-fold>

 

private void blockActionPerformed(java.awt.event.ActionEvent evt) {
if (block.isSelected()) {
//reset();
irb.setEnabled(false);
ibg.setEnabled(true);
blocking.setEnabled(true);
}
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

if (block.isSelected())
{
j_rec=Double.parseDouble(jml_rec.getText().trim());
p_rec=Double.parseDouble(pjg_rec.getText().trim());
dd=Double.parseDouble(data_den.getText().trim());
ibgg=Double.parseDouble(ibg.getText().trim());
lp=Double.parseDouble(laju_pita.getText().trim());
bf=Double.parseDouble(blocking.getText().trim());

pjg_pit=((j_rec/bf)*((bf*p_rec/dd)+ibgg));
pjg_pita.setText(String.valueOf(pjg_pit));
pjg_akses=pjg_pit/lp;
lama.setText(String.valueOf(pjg_akses));
pjg_rate=j_rec*p_rec/pjg_akses;
tr.setText(String.valueOf(pjg_rate));
}
else
{
j_rec=Double.parseDouble(jml_rec.getText().trim());
p_rec=Double.parseDouble(pjg_rec.getText().trim());
dd=Double.parseDouble(data_den.getText().trim());
irgg=Double.parseDouble(irb.getText().trim());
lp=Double.parseDouble(laju_pita.getText().trim());

pjg_pit=(j_rec*((p_rec/dd)+irgg));
pjg_pita.setText(String.valueOf(pjg_pit));
pjg_akses=pjg_pit/lp;
lama.setText(String.valueOf(pjg_akses));
pjg_rate=j_rec*p_rec/pjg_akses;
tr.setText(String.valueOf(pjg_rate));
}
}

private void jml_recActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
pjg_rec.setText(“”);
jml_rec.setText(“”);
irb.setText(“”);
ibg.setText(“”);
blocking.setText(“”);
laju_pita.setText(“”);
data_den.setText(“”);
pjg_pita.setText(“”);
lama.setText(“”);
tr.setText(“”);

}

private void nonblokActionPerformed(java.awt.event.ActionEvent evt) {
if (nonblok.isSelected()){
//reset();
ibg.setEnabled(false);
blocking.setEnabled(false);
irb.setEnabled(true);
}
// TODO add your handling code here:
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new tampilan().setVisible(true);
}
});
}}

Runing program awal

metode Blocking

metode non blocking

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *