Thursday, May 2, 2013

netbeans Lesson 2


Q2. To calculate the Simple Interest.




private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
System.exit(0);
    }                                       

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
 txtcn.setText(" ");
 txtp.setText(" ");
 txtt.setText(" ");
 txtr.setText(" ");
 txtsi.setText(" ");
 txtta.setText(" ");
    }                                       

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
String cn = txtcn.getText();
int p = Integer.parseInt(txtp.getText());
int t = Integer.parseInt(txtt.getText());
int r = Integer.parseInt(txtr.getText());
double s,ta ;
s = (p * r * t)/100 ;
ta = ( p+s) ;
txtsi.setText(" "+s);
txtta.setText(" "+ta);
    }                                        

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...