Jumat, 03 April 2015

TUGAS PRAKTIKUM PEMROGRAMAN VISUAL MODUL 5

Diposting oleh yuli yanti di 22.55



TUGAS PRAKTIKUM PEMROGRAMAN VISUAL
MODUL 5

soal : Buatlah Sebuah form seperti gambar dibawah ini..

JAWAB :
  1. Tampilan Design awal :



  1. Kode Program untuk button PROSES:

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int a,b,c,d,e;
a = Integer.parseInt(tabsen.getText());
b = Integer.parseInt(ttugas.getText());
c = Integer.parseInt(tuts.getText());
d = Integer.parseInt(tuas.getText());
e =((a * 10/100) + (b * 20/100) + (c * 30/100) + (d * 40/100));
tangka.setText(Integer.toString(e));
if (e >= 80 && e <=100){
thuruf.setText("A");
tket.setText("SANGAT MEMUASKAN");
}else{
if (e >= 70 && e <= 79){
thuruf.setText("B");
tket.setText("MEMUASKAN");
}else{
if (e >= 60 && e <= 69){
thuruf.setText("C");
tket.setText("CUKUP");
}else{
if (e >= 50 && e <= 59){
thuruf.setText("D");
tket.setText("");
}else{
thuruf.setText("B");
tket.setText("MEMUASKAN");
}
}
}
}
}
  1. Kode Program untuk Button CLEAR :

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
tnim.setText("");
tnama.setText("");
tabsen.setText("");
ttugas.setText("");
tuts.setText("");
tuas.setText("");
tangka.setText("");
thuruf.setText("");
tket.setText("");
}

  1. Kode Program untuk Button KELUAR :

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


  1. pilih run > run file
Hasil Tampilan akhir :


#terimakasih




0 komentar:

Posting Komentar

 

next level Copyright © 2010 Design by Ipietoon Blogger Template Graphic from Enakei