1. Deskripsi
Program ini
adalah aplikasi penghitung nilai mahasiswa sederhana dengan menggunakan
netbeans. Program ini memudahkan dosen untuk menghitung kriteria lulus atau
tidaknya mahasiswa dalam sebuah mata kuliah tertentu. Cara penggunaannya adalah
:
·
Input Nama Mahasiswa
·
Input NIM
·
Input Kelas Mahasiswa
·
Input Nilai Tugas
·
Input Nilai UTS
·
Input Nilai UAS
·
Input Jumlah Kehadiran
Setelah mengisi
kolom, tekan tombol hitung, maka program akan menampilkan jumlah rata-rata dari
nilai mahasiswa tersebut. Selain itu, secara otomatis program ini juga akan
menampilkan Grade mahasiswa berdasarkan kriteria rata-rata nilai yang didapat. Selain
itu juga program ini dapat menampilkan apakah mahasiswa tersebut lulus atau
tidak. Keterangan lulus atau tidak ini berdasarkan grade yang didapat.
2. ScreenShoot
3. Source
Code
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author USER
*/
public class uasss extends javax.swing.JFrame {
/**
* Creates new form uasss
*/
public uasss() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
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();
lblNama = new javax.swing.JTextField();
lblNIM = new javax.swing.JTextField();
lblkelas = new javax.swing.JTextField();
lblTugas = new javax.swing.JTextField();
lblUAS = new javax.swing.JTextField();
lblUTS = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
lblKehadiran = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
lblKeterangan = new javax.swing.JLabel();
lblhuruf = new javax.swing.JLabel();
hitung = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
textarea = new javax.swing.JTextArea();
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("Nama");
jLabel2.setText("NIM");
jLabel3.setText("Kelas");
jLabel4.setText("Nilai Tugas");
jLabel5.setText("Nilai UAS");
jLabel6.setText("Nilai UTS");
lblNama.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblNamaActionPerformed(evt);
}
});
lblNIM.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblNIMActionPerformed(evt);
}
});
lblkelas.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblkelasActionPerformed(evt);
}
});
lblTugas.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblTugasActionPerformed(evt);
}
});
lblUAS.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblUASActionPerformed(evt);
}
});
lblUTS.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblUTSActionPerformed(evt);
}
});
jLabel7.setText("Kehadiran");
lblKehadiran.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblKehadiranActionPerformed(evt);
}
});
jLabel8.setText("Keterangan");
jLabel9.setText("Huruf");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblUTS, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblNama))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblNIM, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblkelas, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblTugas, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblUAS, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblKehadiran, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
.addComponent(lblKeterangan, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblhuruf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(lblNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(lblNIM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(lblkelas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(lblTugas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(lblUAS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(lblUTS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(lblKehadiran, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(lblKeterangan))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9)
.addComponent(lblhuruf))
.addContainerGap(47, Short.MAX_VALUE))
);
hitung.setText("Hitung");
hitung.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
hitungActionPerformed(evt);
}
});
textarea.setColumns(20);
textarea.setRows(5);
jScrollPane1.setViewportView(textarea);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(155, 155, 155)
.addComponent(hitung)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(hitung)
.addGap(34, 34, 34))
);
pack();
}// </editor-fold>
private void lblNamaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblNIMActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblkelasActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblTugasActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblUASActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblUTSActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void lblKehadiranActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void hitungActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double kehadiran,tugas,uts,uas,nilai;
String hasil;
kehadiran = Integer.parseInt(lblKehadiran.getText());
tugas = Integer.parseInt(lblTugas.getText());
uts = Integer.parseInt(lblUTS.getText());
uas = Integer.parseInt(lblUAS.getText());
nilai =(kehadiran/16*10)+(tugas*20/100)+(uts*30/100)+(uas*40/100);
hasil = String.valueOf(nilai);
textarea.setText(hasil);
if(nilai>=85){
lblhuruf.setText("A");
lblKeterangan.setText("LULUS");
}
else if ((nilai<84)&&(nilai>=70)){
lblhuruf.setText("B");
lblKeterangan.setText("LULUS");
}
else if ((nilai<70)&&(nilai>=55)){
lblhuruf.setText("C");
lblKeterangan.setText("Mengulang");
}
else if ((nilai<55)&&(nilai>=40)){
lblhuruf.setText("D");
lblKeterangan.setText("Mengulang");
}
else if ((nilai<40)&&(nilai>=0)){
lblhuruf.setText("E");
lblKeterangan.setText("Tidak Lulus");
}
textarea.setText(
"NAMA: "+lblNama.getText()+"\n"+
"NIM: "+lblNIM.getText()+"\n"+
"Kelas: "+lblkelas.getText()+"\n"+
"Absen: "+lblKehadiran.getText()+"\n"+
"Tugas: "+lblTugas.getText()+"\n"+
"UTS: "+lblUTS.getText()+"\n"+
"UAS: "+lblUAS.getText()+"\n"+
"Hitung: "+hitung.getText()+"\n"+
"Huruf: "+lblhuruf.getText()+"\n"+
"Keterangan: "+lblKeterangan.getText()+"\n");
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(uasss.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(uasss.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(uasss.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(uasss.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new uasss().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton hitung;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
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.JTextField lblKehadiran;
private javax.swing.JLabel lblKeterangan;
private javax.swing.JTextField lblNIM;
private javax.swing.JTextField lblNama;
private javax.swing.JTextField lblTugas;
private javax.swing.JTextField lblUAS;
private javax.swing.JTextField lblUTS;
private javax.swing.JLabel lblhuruf;
private javax.swing.JTextField lblkelas;
private javax.swing.JTextArea textarea;
// End of variables declaration
}