Menghitung Nilai Semester Menggunkan Java

Program Nilai akhir Semester

public NilaiAkhir() {
setTitle(“Menghitung Nilai Akhir Semester”);
initComponents();
}
private void n_akhir(){
float n_tugas=Float.valueOf(txttugas.getText())*(float)0.15;
float n_kuis=Float.valueOf(txtkuis.getText())*(float)0.15;
float n_mid=Float.valueOf(txtmid.getText())*(float)0.3;
float n_uas=Float.valueOf(txtuas.getText())*(float)0.4;
float total=n_tugas+n_kuis+n_mid+n_uas;
String n_total=String.valueOf(total);
txtangka.setText(n_total);
if (total>=90){
txthuruf.setText(“A”);
}
else if(total>=70&&total<90){
txthuruf.setText(“B”);
}
else if(total>=60&&total<70){
txthuruf.setText(“C”);
}
else if(total>=50&&total<60){
txthuruf.setText(“D”);
}
else{
txthuruf.setText(“E”);
}
}
private void cmdhitungActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
n_akhir();
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: