Professional Documents
Culture Documents
(Code 065)
Class XII
(Theory)
1. Networking and open standards 10 marks
2. Programming 25 marks
3. Relational Database Management System 30 marks
4. IT Applications 5 marks
(Practical)
1. Problem Solving using Java 10 marks
2. SQL Queries 5 marks
3. Practical Record File 5 marks
4. Project file 5 marks
5. Viva Voce 5 marks
Ques: WAP to Input three Numbers A,B,C and display them in ascending .
Solution:int a=Integer.parseInt(jTextField1.getText());
int b=Integer.parseInt(jTextField2.getText());
int c=Integer.parseInt(jTextField3.getText());
}
Ques: WAP to input a number a check whether it is +ve,-ve or ZERO
Solution:
int a=Integer.parseInt(jTextField1.getText());
if (a<0)
jLabel2.setText(“”+”Number is negative”);
if (a>0)
jLabel2.setText(“”+”Number is Positive”);
else
jLabel2.setText(“”+”Number is ZERO”);
Solution:
Solution:
int a=Integer.parseInt(jTextField1.getText());
switch(a)
{
case 1 :
jLabel2.setText("Sunday");
break;
case 2 :
jLabel2.setText("Monday");
break;
case 3 :
jLabel2.setText("Tuesday");
break;
case 4 :
jLabel2.setText("Wednesday");
break;
case 5 :
jLabel2.setText("Thursday");
break;
case 6 :
jLabel2.setText("FRiday");
break;
case 7 :
jLabel2.setText("Saturday");
break;} }
Ques: WAP to Input any number and display it in reverse order
Solution:
int a=Integer.parseInt(jTextField1.getText());
int r,x;
r=0;
while(a!=0)
{
x=a%10;
r=r*10+x;
a=(int)(a/10);
}
jLabel2.setText(""+r) }
Ques :WAP to input a number an d display sum of its digits
Solution;
int a=Integer.parseInt(jTextField1.getText());
int s,x;
s=0;
while(a!=0)
{
x=a%10;
s=s+x;
a=(int)(a/10);
}
jLabel2.setText(""+s);
}
jLabel2.setText(""+jLabel2.getText()+" "+x);
x=x+2;
}
Ques: WAP to display
1
12
123
1234
Solution:
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.println();
}
Solution:
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(i);
}
System.out.println();
}
4321
432
43
4
int i,j;
for(i=1;i<=4;i++)
{
for(j=4;j>=i;j--)
{
System.out.print(j);
}
System.out.println(i);
}
Prime number
int f,i;
int
n=Integer.parseInt(jTextField1.getText());
f=0;
for (i=2;i<=n/2;i=i+1)
{if(n%i==0)
{f=0;
break;}
else
f=1;}
if(f==1)
jLabel2.setText(""+"Nuumber is a PRIME number");
else
jLabel2.setText(""+"Number is NOT a PRIME number");
}
Alphabets
String s=new String(jTextField1.getText());
char c=s.charAt(0);
int a=(int)c;
if (a>=65 && a<=90 || a>=97 && a<=123)
jLabel2.setText(""+"Alphabet");
else
{
jLabel2.setText("Only Alphabets Allowed ,Please Retry");
jTextField1.setText(" ");
}
To print c*m*u*e*
String s=new String(jTextField1.getText());
int i=0;
int l=s.length();
while(i<=l-1)
{
char c=s.charAt(i);
if(i%2==0)
jLabel2.setText(""+jLabel2.getText()+c);
else
jLabel2.setText(""+jLabel2.getText()+"*");
i++;
}
jLabel2.setText(""+jLabel2.getText()+c);
i--;
}