Thursday, May 2, 2013

netbeans lesson 1

Q1.PROGRAM TO CALCULATE PERCENTAGE.




CODING
  private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);        // TODO add your handling code here:
    }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
txtsn.setText(" ");        // TODO add your handling code here:\
txtmo.setText("");
txtmm.setText(" ");
txtp.setText(" ");
    }

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String sn= txtsn.getText();
int mo = Integer.parseInt(txtmo.getText());
int mm = Integer.parseInt(txtmm.getText());
double p ;
p=(mo*100)/mm;
txtp.setText(" "+p);
    }



No comments:

Post a Comment

  A Potential Showdown: Kamala Harris vs. Donald Trump As the political landscape gears up for the next election cycle, the prospect of a fa...