cbse ip practical file 2015 (java and mysql)

45
1 PROGRAM ONE--------------------------------------------- ---------------------------- Aim : To make a program which appends the information given. Design : Code : For Submit Button – String a = t1.getText(); String b = t9.getText(); String c = t3.getText(); String d = t4.getText(); String e = t5.getText(); String f = t6.getText(); ta.append("Name : "+a+"\n"+"House no :"+b+"\n"+"Building :"+c+"\n"+"Street :"+d+"\n" +"City :"+e+"\n"+"State :"+f+"\n"); Output : ////////////////////////////////////////////////Arnav Solanki /////// XII A//////Roll No. 5

Upload: arnav-solanki

Post on 04-Oct-2015

81 views

Category:

Documents


16 download

DESCRIPTION

This is a complete IP practical file with all assignments for Java and MySQL as per the CBSE syllabus.

TRANSCRIPT

[Type text]

1PROGRAM ONE-------------------------------------------------------------------------

Aim : To make a program which appends the information given.

Design :

Code : For Submit Button String a = t1.getText();String b = t9.getText();String c = t3.getText();String d = t4.getText();String e = t5.getText();String f = t6.getText();ta.append("Name : "+a+"\n"+"House no :"+b+"\n"+"Building:"+c+"\n"+"Street :"+d+"\n"+"City :"+e+"\n"+"State :"+f+"\n");

Output :

PROGRAM TWO------------------------------------------------------------------------

Aim : To make a calculator.

Design :

Code : For add button : Double n1,n2,n3;n1 = Double.parseDouble(t1.getText());n2 = Double.parseDouble(t2.getText());n3 = n1+n2;l1.setText(""+n3);

For subtract button : Double n1,n2,n3; n1 = Double.parseDouble(t1.getText()); n2 = Double.parseDouble(t2.getText()); n3 = n1-n2; l1.setText(""+n3);

For multiply button : Double n1,n2,n3; n1 = Double.parseDouble(t1.getText()); n2 = Double.parseDouble(t2.getText()); n3 = n1*n2; l1.setText(""+n3);

For divide button : Double n1,n2,n3; n1 = Double.parseDouble(t1.getText()); n2 = Double.parseDouble(t2.getText()); n3 = n1/n2; l1.setText(""+n3);

For clear button : t1.setText(""); t2.setText(""); l1.setText("");

Output :

PROGRAM THREE----------------------------------------------------------------------

Aim : To make a program that counts integers between two given integers.

Design :

Code : For Count button : double i =Double.parseDouble(t1.getText()); double j =Double.parseDouble(t2.getText()); if(j=13 && age