Saturday, July 20, 2013

NetBeans 10

Tips:
For checking Condition use if
For using choice use Switch()
For repeated loop use for,while or do while

Thursday, July 18, 2013

lesson 9







private void txtsStateChanged(javax.swing.event.ChangeEvent evt) {                                  
int c = txts.getValue();
txtc.setText(""+c+"CELCIUS");
int f = ((c*9)/5)+32;
txtf.setText(""+f+"FAHRENHEIT");

    }

netbeans lesson 8




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

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SI().setVisible(true);
            }
        });
    }

Monday, June 24, 2013

Netbeans Lesson 7

Example 1. Write a program to print the output like below.
1
10
100
1000
.
.
10 term.
Program:-

int a,b;
a=1;b=1;
while (a<=10)
{
system.out.print(b)
b=b*10;
a++;
}

Netbeans Lesson 6

While Loop:
While statement is used to execute the set of instruction in its loop untill the condition is true. It will keep on executing the commands in its loop untill the condition become false.
Syntax :
while (<expression or condtion>)
{
set of statements
.
.
n;
}

Example
To the following series with while loop.
1,2,3,4,----------10

int a;
a=1;
while(a<=10)
{
System.out.print(a);
a++;
}

if want to print this in c Language or c++ then simply write printf(a) in c and cout<<a in c++ to get the same result.

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


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