Dr. M.K.K Arya Model School IT Practical Information Technology (802) Class XI

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Dr. M.K.

K Arya Model School


IT Practical
Information Technology(802)
Class XI
MYSQL

1. create table student(rollno integer,name varchar(25),gender char(1),marks decimal(5,2),DOB date);


insert into student values(2,'Deep Singh','M',98,'1998-08-22');
insert into student values(4,'Radhika Gupta','F',78.5,'1999-12-03');
insert into student values(1,'Raj Kumar','M',93,'2000-11-17');
insert into student values(9,'Shreya Anand','F',70.5,'1999-10-08');
insert into student values(7,'Gurpreet Kaur','F',65,'2000-01-04');
insert into student values(10,'Prateek Mittal','M',75.5,'2000-12-25');
insert into student(rollno,name) values(3,'Ankit Sharma');
select * from student;

select * from student where gender='M';


SELECT ROLLNO,NAME,DOB
WHERE DOB BETWEEN ‘1999-01-01’ AND ‘2000-12-31’

select rollno,name,dob from student order by name;

select rollno,name,dob from student order by rollno desc;

select rollno,name,marks from student order by rollno desc,marks;

select rollno,name,marks+5 from student;


select rollno||" "||name from student;

select distinct name from student;

select rollno,name,marks from student where marks>=70 or rollno>5;

select rollno,name,marks from student where name in ('Deep Singh','Raj Kumar');


select avg(marks),max(marks),min(marks) from student;

select sum(marks) from student;

select count(name) from student;

2. create table emp(eno integer,ename varchar(25),job varchar(20),hiredate date,sal


decimal(7,2),deptno integer);
insert into emp values(8369,'SMITH','CLERK','1990-12-18',8000.00,20);
insert into emp values(8499,'ANYA','SALESMAN','1991-02-20',16000,30);
insert into emp values(8566,'MAHADEVAN','MANAGER','1991-04-02',24500,20);
insert into emp values(8888,'SCOTT','ANALYST','1992-12-09',30500,20);
insert into emp values(8934,'MITA','CLERK','1992-01-23',13000,10);
insert into emp values(8839,'AMIR','PRESIDENT','1991-11-18',50000,10);

SELECT COUNT(ENAME),DEPTNO FROM EMP GROUP BY DEPTNO HAVING


DEPTNO=20;
To display the sum of salaries in each dept

To display max salary in each dept


Display department name of all employees
select emp.eno,emp.ename,dept.dname from emp,dept where emp.deptno=dept.deptno;
JAVA

1. Design the following form and display personalised code in the text field.
2. Display Title using Radio Buttons

3. Calculations using TextFields


4. Calculations involving decimals using TextFields

5. Calculating Simple Interest


IF STATEMENT

6. Checking eligibility to vote

7. Grade Calculator
8. Scholarship Eligibility Calculator

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (Integer.parseInt(jTextField1.getText())>=75)
jTextArea1.setText("Congratulation!\nYou Get the SCHOLARSHIP!!");
else
jTextArea1.setText("Work Hard!\n Make sure that you Get the SCHOLARSHIP in the next Exam!!");
}

9. Sports Charges Calculator


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double Amount=0;
if (jCheckBox1.isSelected())//Foot Ball Charges
{
jTextField1.setText("2500");
Amount=Amount+2500;
}
if (jCheckBox2.isSelected())//Volley Ball Charges
{
jTextField2.setText("1500");
Amount=Amount+1500;
}
if (jCheckBox3.isSelected())//Cricket Charges
{
jTextField3.setText("2000");
Amount=Amount+2000;
}
if (jCheckBox4.isSelected())//Badminton Charges
{
jTextField4.setText("3000");
Amount=Amount+3000;
}
if (jCheckBox5.isSelected())//Table Tennis Charges
{
jTextField5.setText("3500");
Amount=Amount+3500;
}
jTextField6.setText(Double.toString(Amount)); }
10.Restaurant Order calculator
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int Total=0;
if (jList1.isSelectedIndex(0)==true)
{
Total=Total+150;
JOptionPane.showMessageDialog(this,"Bhel Puri Ordered Rs.150");
}
if (jList1.isSelectedIndex(1)==true)
{
Total=Total+300;
JOptionPane.showMessageDialog(this,"Pasta Ordered Rs.300");
}
if (jList1.isSelectedIndex(2)==true)
{
Total=Total+200;
JOptionPane.showMessageDialog(this,"Pizza Ordered Rs.200");
}
if (jList1.isSelectedIndex(3)==true)
{
Total=Total+180;
JOptionPane.showMessageDialog(this,"Burger Ordered Rs.180");
}
if (jList1.isSelectedIndex(4)==true)
{
Total=Total+220;
JOptionPane.showMessageDialog(this,"Pav Bhaji Ordered Rs.220");
}

if (jList1.isSelectedIndex(5)==true)
{
Total=Total+260;
JOptionPane.showMessageDialog(this,"Chhole Kulche Ordered Rs.260");
}
if (jList1.isSelectedIndex(6)==true)
{
Total=Total+260;
JOptionPane.showMessageDialog(this,"Chowmein Ordered Rs.260");
}
jTextField1.setText(Integer.toString(Total));
}

11.Develop an application to take an input in TextField for a number. If the number is


even then Display its square otherwise its cube in a separate TextFields.

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
int num,sq,cube;
num=Integer.parseInt(jTextField1.getText());
if (num%2==0)
{
sq=num*num;
jTextField2.setText(Integer.toString(sq));
}
else
{
cube=num*num*num;
jTextField3.setText(Integer.toString(cube));
}
}
12.Mr. Sunderam with his family visited Big Bazar Shopping Mall. His family members purchased a variety
of products including garments. The total amount goes into some thousands. The owner of the shopping
mall provides discounts on credit cards as shown below :

Card Type %Discount


HDFC 12.0
SBI 8
VISA 9.5

(a) Write code to calculate discount and net amount.


(b) Write code for Exit button

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
double discount=0,net_amount=0;
double amount=Double.parseDouble(jTextField1.getText());
if (jRadioButton1.isSelected())
discount=amount*0.12;
else if (jRadioButton2.isSelected())
discount=amount*0.08;
else if (jRadioButton3.isSelected())
discount=amount*9.5/100;
net_amount=amount-discount;
jTextField2.setText(Double.toString(discount));
jTextField3.setText(Double.toString(net_amount));

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy