Professional Documents
Culture Documents
Vishwajeet Srivastav IT Project Work
Vishwajeet Srivastav IT Project Work
Vishwajeet Srivastav IT Project Work
TECHNOLOGY
Programming file
NAME – VISHWAJEET SRIVASTAV
CLASS – XIIth- ENAME :
ROLL N0. –
CLASS : xii
SUBJECT – INFORMATION TECHNOLOGY
ROLL NO:
PART-1
JAVA
NET
BEANS
Q-1 Write a code in Java to enter two numbers and swap them.
Q-5 Write a code to enter two numbers and accept choice from the user
according to the selection done by him in the check box and display the
desired result.
switch(n)
{
case 1:
ansTF.setText(“monday”);
break;
case 2:
ansTF.setText(“tuesday”);
break;
case 3:
ansTF.setText(“wednesday”);
break;
case 4:
ansTF.setText(“thursday”);
break;
case 5:
ansTF.setText(“friday”);
break;
case 6:
ansTF.setText(“saturday”);
break;
case 7:
ansTF.setText(“sunday”);
break;
default :
ansTF.setText(“Wrong Choice”);
Q-6 Write a code to print the table of the number entered by the user.
Q-8 Write a code to print the factorial of a number entered by the user.
private void factBtnActionPerformed(java.awt.event.ActionEvent evt) {
int ans=1;
int n=Integer.parseInt(nTF.getText());
for (int i=1;i<=n;i++)
{ans=ans*i;
}
System.out.println(ans);
}
Q-9 Write a code to accept a number from the user and print whether it is
prime number or not.
Q-11 Write a code to enter name and Fees of the members in the
respective textfields . On the basis of the type of the membership and the
selected sports, Calculate Total fees that has to be paid by the member.
{
fees=fees+700;
}
if(bchk.isSelected()==true)
{
fees=fees+450;
}
tftxt.setText(""+fees);
}
bill=500+(u-100)*7;
else
if(u<=200&&u<=300)
bill=500+700+750+(u-200)*7.50;
else
if(u>=300)
bill=500+700+750+800+(u-300)*8;
billTF.setText(""+bill);
}
if(s>=4000)
{
hra=(s*37)/100;
da=(s*35)/100;
else
if(s>=20000)
hra=(s*32)/100;
da=(s*25)/100;
else
{
hra=(s*30)/100;
da=(s*25)/100;
}
ns=s+da+hra;
nsTF.setText(""+ns);
daTF.setText(""+da);
hraTF.setText(""+hra);}
PART-2
SQL
Consider the following relation ‘STUDENT’
Q1.To Create the above table (the following constraint applied on the above table
Roll No as PRIMARY
KEY and name as NOT NULL).
SQL>CREATE TABLE STUDENT (ROLLNO NUMBER(3)PRIMARY KEY, NAME VARCHAR(20)
NOT NULL, AGE NUMBER92), DEPARTMENT VARCHAR(15), DATE_ADM DATE, FEES
NUMBER(4), SEX CHAR(1));
OUTPUT
Table created
SQL>INSERT INTO STUDENT VALUES (100, ‘SANJANA’, 24, ‘COMPUTER’, ‘10-JAN-97’,1200, ‘F ’);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (110, ‘SANJAY’, 20, ‘HINDI’, ‘6-AUG-99’, 600, ‘M’);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (115, ‘MANI’, 19, ‘HISTORY’, ‘10-JAN-99’, 900, ‘M’);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (120, ‘POONAM’, 37, ‘ENGLISH’, ‘10-OCT-99’, 500, ‘F’);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (125, ‘SURYA’, 35, ‘HINDI’, ‘11-DEC-97’, 800, ‘M’);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (130, ‘SHIKA’, 26, ‘COMPUTER’, ‘31-JUL-97’, 1300’, ‘F ‘);
OUTPUT
1 row inserted
SQL>INSERT INTO STUDENT VALUES (132, ‘RAJA’, 29, ‘COMPUTER’, ‘1-JAN-99’, 1500, ‘M’);
OUTPUT
1 row inserted
OUTPUT
Q4.To display name of those student whose age is between 20 and 25.
OUTPUT
SANJAY
SANJANA
Q5.To display name and department of all the students whose fees is greater than 1000
SQL>SELECT NAME, DEPARTMENT FROM STUDENT WHERE FEES>1000;
OUTPUT
NAME DEPARTMENT
SANJANA COMPUTER
SHIKHA COMPUTER
RAJA COMPUTER
Q6.To display name and age of the student who either belong to Hindi, History or
English department.
SQL>SELECT NAME, AGE FROM STUDENT WHERE DEPT IN (‘HINDI’, ‘HISTORY’, ‘ENGLISH’);
OUTPUT
NAME AGE
SHALINI 31
SANJAY 20
MANI 19
POONAM 37
SURYA 35
OUTPUT
DEPARTMENT
COMPUTER
HISTORY
HINDI
ENGLISH
OUTPUT
5
OUTPUT
DEPARTMENT SUM (FEES)
COMPUTER 4000
HISTORY 500
HINDI 1400
ENGLISH 1700
Q10.To display the average fees of female computer students.
SQL>SELECT AVG (FEES) FROM STUDENT WHERE SEX = ‘F’ AND DEPARTMENT =
‘COMPUTER’;
OUTPUT
1350
Q11.To display Name, Age and Date of Admission of the student according to the
alphabetic orders of their name.
OUTPUT
NAME AGE DATE_ ADM
MANI 19 10-JAN-99
POONAM 37 10-OCT-99
RAJA 29 1-JAN-99
SANJANA 24 10-JAN-97
SANJAY 20 6-AUG-99
SHALINI 31 5-MAY-98
SHIKHA 26 31-JUL-97
SURYA 35 11-DEC-97
Q12.To Count the total number of department where number of student are more
then 2.
SQL>SELECT COUNT (*) FROM STUDENT GROUP BY DEPARTMENT HAVING COUNT (NAME)
>2;
OUTPUT
1
OUTPUT
8 ROWS UPDATED
Q14. To delete the record of those students whose age is greater than and equal to 35 and
Date _of _Adm is less than 01-Jan-99.
SQL> DELETE FROM STUDENT WHERE AGE >=35 AND DATE_ADM < ‘01-JAN-99’;
OUTPUT
2 ROW DELETED
OUTPUT
TABLE DROPPED.