0% found this document useful (0 votes)
16 views3 pages

Class 11 Information Technology

Uploaded by

sijumeerafly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Class 11 Information Technology

Uploaded by

sijumeerafly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Class 11

Information Technology
Note: All students are required to study the provided programs & MySQL. In your practical exam,
you will be tasked with writing and executing any one of these Java programs & MySQL tables
without making any errors.

Java Programs
1. Design a GUI application to accept a character in a text field and print in a label if that character is
a vowel: a, e, i, o, or u. The application should be case sensitive.

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


char c=jTextField1.getText().charAt(0);
if( c== 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'|| c== 'A' || c == 'E' || c == 'I' || c == 'O' || c ==
'U')
jTextField2.setText("This character is a vowel");
}
2. Design a GUI application to accept the cost price and selling price form the user in two text field

then calculate the profit or loss incurred.

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


int cp=Integer.parseInt(jTextField1.getText());
int sp=Integer.parseInt(jTextField2.getText());
if (cp>sp)
jTextField3.setText("Loss!!");
else
jTextField3.setText("Profit!!"); }
3. Design a GUI application to accept a number from the user in a text field and print using option
pane whether it is a positive even number or not.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int x=Integer.parseInt(jTextField1.getText());
if (x%2==0)
javax.swing.JOptionPane.showMessageDialog(null,"Even Number");
else
javax.swing.JOptionPane.showMessageDialog(null, "Odd Number");
}
MySQL
1. Write SQL commands to answer the queries based on Fabric table.
FID Fname type disc
f001 shirt woolen 10
f002 suit cotton 20
f003 tunic cotton 10
f004 jeans denim 5
1. Write a query for insert the following record: f005, kurta, woolen, 5
Insert into fabric(fid,fname,type,disc) values(“f005”, “kurta”, “woolen”, 5);
2.Write a query to display only those fabric whose disc is more than 10.
SELECT*FROM FABRIC WHERE DISC>10;
3.To display those records whose type of ‘woolen’.
SELECT*FROM FABRIC WHERE TYPE=”WOLLEN”;

2. Write SQL commands to answer the queries based on Fabric table.


FID Fname type disc
f001 shirt woolen 10
f002 suit cotton 20
f003 tunic cotton 10
f004
2. jeans denim 5
1. To modify the fabric shirt by increasing discount by 10%.
update fabric set disc=disc+10 -> where fname="shirt";
2. To delete the record of fabric f003 from table.
delete from fabric -> where fid=”f003”;
3. Add another column called price with decimal data type.
alter table fabric add price decimal(8,2);

3. Consider the following Vendor table and write the queries.


VID Vname DateOfRegistration Location
v001 Mother Dairy 20-01-2009 “” delhi
v002 Havmor 01-04-2015 Gujrat
v003 amul 12-05-2012 Kolkata
v004
4. Kwality Walls 15-10-2013 Mumbai
1. Write a query to display records except amul.
2. Write a query to add a new row with the following details: v005, vadilal, 2020-03-20, pune.
insert into vendor102(VID,VNAME,DATEOFREGISTRATION,LOCATION)
VALUES("V005","vadilal","2020/03/20","pune");
3. Write a query to modify the location of v003 from Kolkata to Gujarat.
update vendor102 set location="gujarat" where vid="V003";

You might also like