Jumat, 11 November 2016

Tugas UAS Semester Ganjil 2016/2017





MENCARI LUAS SEGI 4
NAMA     : ILHAM DANU SAPUTRA
NIM          :161011700411
RUANG   :502/604


>>>>>SOAL

MENCARI LUAS SEGI 4 =PxL
contoh diketahui panjang =12
                             Lebar   =12

 >>>>>SOURCE CODE HASIL

// TODO add your handling code here:
        int Panjang,Lebar,Luas;
        Panjang=Integer.parseInt(TextPanjang.getText());
        Lebar=Integer.parseInt(TextLebar.getText());
        Luas=Panjang*Lebar;
        TextLuas.setText(""+Luas);
       
    }                                         

    private void TextHapusActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        TextPanjang.setText("");
        TextLebar.setText("");
        TextLuas.setText("");
    }

 





  



>>>>>RUN
                               


>>>>> 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(luaspersegi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(luaspersegi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(luaspersegi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(luaspersegi.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 luaspersegi().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                   
    private javax.swing.JLabel Ilhamds98;
    private javax.swing.JLabel Judul;
    private javax.swing.JButton TextHapus;
    private javax.swing.JButton TextHitung;
    private javax.swing.JTextField TextLebar;
    private javax.swing.JTextField TextLuas;
    private javax.swing.JTextField TextPanjang;
    private javax.swing.JLabel ilhamds05;
    private javax.swing.JLabel ilhamds24;
    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;
    // End of variables declaration                 
}



SEKIAN DAN TERIMAKASIH

Tidak ada komentar:

Posting Komentar