Thursday, May 9, 2013

Netbeans Lesson 5


Q4. To find eligibility for vote.



    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int age;
String txt = txta.getText();
age = Integer.parseInt(txt);
if(age>=18)
    txtm.setText("YOU ARE ELIGIBLE VOTER");
else
    txtm.setText("YOU ARE NOT ELIGIBLE FOR VOTING");
    }

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

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
txtm.setText(" ");
txta.setText(" ");

    }


Monday, May 6, 2013

mysql lesson 3



mysql> UPDATE EMP SET SAL =850 WHERE SAL =800;
Query OK, 1 row affected (0.10 sec)
Rows matched: 1  Changed: 1  Warnings: 0SELECT * FROM EMP WHERE JOB='CLERK' AND COMM<=100 ;
mysql> ALTER TABLE EMP MODIFY JOB CHAR(30);
Query OK, 1 row affected (0.27 sec)
Records: 1  Duplicates: 0  Warnings: 0

EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
8369
SMITH
CLERK
8902
1990-12-18
800
100
20
8999
HARPREET
CLERK
8878
1992-03-20
300
100
20


SELECT * FROM EMP WHERE(JOB = 'SALESMAN' AND SAL>= 300) OR (JOB = 'MANAGER' AND SAL>= 200);

EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
8499
ANYA
SALESMAN
8698
1991-02-20
1600
300
30
8521
SETH
SALESMAN
8698
1991-02-22
1250
500
30
8566
MAHADEVAN
MANAGER
8839
1991-04-02
2985
200
20
8698
BINA
MANAGER
8839
1991-05-01
2850
400
30
8839
AMIR
MANAGER
8840
1991-11-18
3000
200
10
8993
TAJINDER
SALESMAN
8888
1992-03-11
3300
210
10


netbeans Lesson 4


Q3. To Calculate  %age using if/else command.



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("");
txtfn.setText(" ");
txtrn.setText(" ");
txtc.setText(" ");
txte.setText(" ");
txtm.setText(" ");
txtch.setText(" ");
txtco.setText(" ");
txtt.setText(" ");

txtp.setText(" ");
txtg.setText(" ");
txtph.setText(" ");
    }                                        

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
int e = Integer.parseInt(txte.getText());
int m = Integer.parseInt(txtm.getText());
int ch = Integer.parseInt(txtch.getText());
int ph = Integer.parseInt(txtph.getText());
int co = Integer.parseInt(txtco.getText());
double t,p;
t =(e+m+ch+ph+co);
p =(t)/5 ;
txtt.setText(" "+t);
txtp.setText(" "+p);
if(p>=90){
    txtg.setText("A");
}
else
    if(p>=70){
        txtg.setText("B");
        }
    else
        if(p>=55){
            txtg.setText("C");
        }
        else
            if(p>=35){
      
         txtg.setText("D");
            }
            else
                if(p<=35){
                    txtg.setText("F");
                }
    }                                       

Thursday, May 2, 2013

Netbeans Lesson 3


Q4. To find eligibility for vote.



    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int age;
String txt = txta.getText();
age = Integer.parseInt(txt);
if(age>=18)
    txtm.setText("YOU ARE ELIGIBLE VOTER");
else
    txtm.setText("YOU ARE NOT ELIGIBLE FOR VOTING");
    }

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

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
txtm.setText(" ");
txta.setText(" ");

    }

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);
    }                                        

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);
    }



mysql lesson 2


  
mysql> INSERT INTO EMP VALUES(8369,'SMITH','CLERK',8902,'1990-12-18',800,100,20);                                                                            
  Query OK, 1 row affected (0.04 sec)         
                                  
mysql> SELECT * FROM EMP ;
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
8369
SMITH
CLERK
8902
1990-12-18
800
100
20
8499
ANYA
SALESMAN
8698
1991-02-20
1600
300
30
8521
SETH
SALESMAN
8698
1991-02-22
1250
500
30
8566
MAHADEVAN
MANAGER
8839
1991-04-02
2985
200
20
8698
BINA
MANAGER
8839
1991-05-01
2850
400
30
8839
AMIR
MANAGER
8840
1991-11-18
3000
200
10
8993
TAJINDER
SALESMAN
8888
1992-03-11
3300
210
10
8999
HARPREET
CLERK
8878
1992-03-20
300
100
20



mysql> SELECT * FROM EMP WHERE JOB='SALESMAN';
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
8499
ANYA
SALESMAN
8698
1991-02-20
1600
300
30
8521
SETH
SALESMAN
8698
1991-02-22
1250
500
30
8993
TAJINDER
SALESMAN
8888
1992-03-11
3300
210
10





mysql> SELECT * FROM EMP WHERE HIREDATE>='1991-12-30';

EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
8993
TAJINDER
SALESMAN
8888
1992-03-11
3300
210
10
8999
HARPREET
CLERK
8878
1992-03-20
300
100
20

funny kids

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