Professional Documents
Culture Documents
School
CERTIFICATE
This is to certify that …………..a student of class
XII-D (COMMERCE) of St. Raphael’s Higher
Secondary School, Indore has completed
Informatics Practices (IP) Practical Assignments.
It is a bona fide piece of work under my
supervision and guidance. To the best of my
knowledge it is the original work of the candidate
and is a result of her own efforts in the partial
fulfillment of the requirement as per CBSE
curriculum of class XII (IP).
External Internal
1
St.Raphael’s H.S. School
CERTIFICATE
This is to certify that ………………… a student of
class XII-D (COMMERCE) of St. Raphael’s Higher
Secondary School, Indore (Session 2017-18) has
completed Informatics Practices (IP) Practical
Assignments.
It is a bona fide piece of work under the guidance
of ‘Mr.Manoj Thomas’ IP lecturer of St. Raphael
H.S School in the partial fulfillment of the
requirement as per CBSE curriculum of class XII
(IP).
2
St.Raphael’s H.S. School
ACKNOWLEDGEMENT
3
St.Raphael’s H.S. School
JAVA PROGRAMMES
4
St.Raphael’s H.S. School
Q1. Write a program to check whether the given number is a multiple of
3, 5 or 7?
5
St.Raphael’s H.S. School
6
St.Raphael’s H.S. School
7
St.Raphael’s H.S. School
Q4.Design a GUI application in which the user enters a number in the text
field and on clicking the button the sum of the digits of the number should
be displayed in a label. Hint : Suppose user enters 123 the output should
be 6(1+2+3).
8
St.Raphael’s H.S. School
results on the click of appropriate buttons (There are four radio buttons -
one for sum, one for average, one for maximum and one for minimum). The
result should be displayed in the fourth text field.
Q6.De
sign a
GUI
9
St.Raphael’s H.S. School
Q7. To calculate selling price depending upon profit margin
10
St.Raphael’s H.S. School
11
St.Raphael’s H.S. School
12
St.Raphael’s H.S. School
13
St.Raphael’s H.S. School
front end for the company. You have to accept book code, Title, Author
and Quantity sold from the user. The Price will be generated depending
upon the book code. Net price should be calculated on the basis of the
discount given.
Bookseller - 25%
School - 20%
Customer - 5%
14
St.Raphael’s H.S. School
15
St.Raphael’s H.S. School
Q12.Create a GUI application to accept the date (as 1), month (as a
number like 3 for March) and year (as 2010) in separate text fields and
display the date in the format:dd/mm/yy
16
St.Raphael’s H.S. School
17
St.Raphael’s H.S. School
18
St.Raphael’s H.S. School
19
St.Raphael’s H.S. School
20
St.Raphael’s H.S. School
21
St.Raphael’s H.S. School
22
St.Raphael’s H.S. School
23
St.Raphael’s H.S. School
24
St.Raphael’s H.S. School
25
St.Raphael’s H.S. School
26
St.Raphael’s H.S. School
QUES 23 : Develop an application to display the no. of occurance of a
particular letter in a particular word .
27
St.Raphael’s H.S. School
Q25.Develop an application to reverse the given number and also find out
whether
the number is a palindrome or not.
28
St.Raphael’s H.S. School
29
St.Raphael’s H.S. School
30
St.Raphael’s H.S. School
31
St.Raphael’s H.S. School
Sales Commission Rate
30001 onwards 15%
22001-30001 10%
12001-22000 7%
5001-12000 3%
0-5000 0%
Commission should be displayed in a Label.
32
St.Raphael’s H.S. School
33
St.Raphael’s H.S. School
34
St.Raphael’s H.S. School
Q33.Design the following application to show day of the week:
35
St.Raphael’s H.S. School
36
St.Raphael’s H.S. School
Q1.Design the following application to find the total bill.If the quantity
field is left empty it should show a massage that field cannot left
empty.Also Save the data in Item table.
37
St.Raphael’s H.S. School
38
St.Raphael’s H.S. School
Q2. Design the following application
39
St.Raphael’s H.S. School
40
St.Raphael’s H.S. School
41
St.Raphael’s H.S. School
42
St.Raphael’s H.S. School
43
St.Raphael’s H.S. School
My-Sql Programmes
44
St.Raphael’s H.S. School
Table : STOCK
Table : DEALERS
Dcode Dname
(i) To display details of all items in the stock table in descending order
of Stkdate.
45
St.Raphael’s H.S. School
(ii)To increase unitpr (unit price) by 20% in the stock table for the items
which has been purchased before 2010.
(iii) To display the details of those items whoseDcode (Dealer Code) is 102
or Qty (Quantity) is more than 50 from the table stock.
(iv) To display minimum unit price of items for each dealer individually as
per Dealer Code from the table stock.
46
St.Raphael’s H.S. School
Q2. Create the following tables Product and Client.Write SQL commands
Table : Product
47
St.Raphael’s H.S. School
Table : Client
(a) To display the details of those clients whose city is not Delhi.
(b) To display the Client name, City From table Client and Product
Name and Price from table Product, with their corresponding matching
P_ID.
48
St.Raphael’s H.S. School
49
St.Raphael’s H.S. School
Q3.Create the following tables Doctor and Salary and execute the SQL
Commands
DOCTOR
50
St.Raphael’s H.S. School
Table :SALARY
(a). Display NAME of all doctors who are in “MEDICINE” having more than
10 years experience and basic more than 10000.
(b). Display the average salary of all doctors working in “ENT” department
using DOCTOR table where as salary=basic + allowance
51
St.Raphael’s H.S. School
(c). Display the minimum ALLOWANCE of female doctors.
(d). Display the highest consultation fee among all male doctors.
EMPLOYEE
ACKERMA
105 SARAH NEW YORK
N
SENGUPT
144 MANILA NEW DELHI
A
52
St.Raphael’s H.S. School
210 GEORGE SMITH HOWARD
DESIGN
D Y TS ON
53
St.Raphael’s H.S. School
Table : COMPANY
ID COMP City
ii) To display product name, company name & price for those items,
which IDs are equal to the IDs of company.
55
St.Raphael’s H.S. School
Q6.Consider the following table CLUB and MEMBER. Write the SQL
commands for the statements (i) to (iv) and output (v).
56
St.Raphael’s H.S. School
Table: CLUB
Table: MEMBER
3 Jasvinder 101
4 Robert 103
(i) To display the name of all the games with their GCodes.
57
St.Raphael’s H.S. School
(ii) To display all information of those games which are having fees more
than 10000.
(iv) To display Name and Number of All the members from the Table
CLUB and MEMBER.
58
St.Raphael’s H.S. School
Q7. Write SQL Commands for (i) to (iv) and write the outputs for (v) on
the basis of table :
Table : FURNITURE
i. To show all the information about the Baby cots from the furniture
table.
ii. To list the itemname which are priced at more than 15000 from the
furniture table.
60
St.Raphael’s H.S. School
Q8. Write the SQL commands for the i) to iv) and write the output of
the (vi) on the basis of table TEACHER.
Table:TEACHER
61
St.Raphael’s H.S. School
No Name Age Departmen Dateofapp Salary Sex
. t
iv) To insert a new row in the TEACHER table with the following data:
9,’Raja’, 26,’Computer’, {13/05/95}, 23000,’M’
63
St.Raphael’s H.S. School
TABLE: EMPLOYEE
TABLE: SALARIES
64
St.Raphael’s H.S. School
65
St.Raphael’s H.S. School
v. SELECT count (*) from EMPLOYEE where SEX = “F”.
Q10. Read the instructions given below and answer accordingly: (MySql)
Write MySql commands for (i) to (x) based on the following table.
SUPPLIERS
67
St.Raphael’s H.S. School
vi) Delete the suppliers from SUPPLIERS table who belongs to state
‘UTTAR PARDESH’.
68
St.Raphael’s H.S. School
Q11.Consider the table Flight given below, write command in SQL for (1)
to (4) and output for (5) to (8).
69
St.Raphael’s H.S. School
Table :FLIGHT
70
St.Raphael’s H.S. School
71
St.Raphael’s H.S. School
Q12. Consider the following table named “GYM” with details about fitness
items being sold in the store.Write command of SQL for (i) to (iv) and
output for (v) to (vii)
Table :GYM
(i)To display the names of all the items whose name starts with “A”.
(iii) To change the Brandname to “Fit trend India” of the item. Whose
ICODE as “G101”.
(iv) Add a new row for a new item in GYM with the details: “G107”,”Vibro
exerciser’,21000,”GTCFitness”
73
St.Raphael’s H.S. School
Q13.
74
St.Raphael’s H.S. School
i)
ii)
75
St.Raphael’s H.S. School
iii)
Q14.
76
St.Raphael’s H.S. School
77
St.Raphael’s H.S. School
6.
78
St.Raphael’s H.S. School
Q15.
79
St.Raphael’s H.S. School
Q16
80
St.Raphael’s H.S. School
Q17
1.
81
St.Raphael’s H.S. School
2.
3.
4.
5.
82
St.Raphael’s H.S. School
6.
7.
Q18.Write SQL commands for (i) to (v) on the basis of the table
Student1.
i) Display the name of the students who have grade ‘C’ in either
Game1 or Game2 or both.
83
St.Raphael’s H.S. School
iii) Display the names of the students who have same game for both
Game1 and Game2
iv) Display the games taken by the students, whose name starts with
‘A’.
Q19.
84
St.Raphael’s H.S. School
85
St.Raphael’s H.S. School
Q20.
86
St.Raphael’s H.S. School
v.
87
St.Raphael’s H.S. School
HTML WEBSITE
88
St.Raphael’s H.S. School
<html>
<head>
<title></title>
</head>
<body background="stars.jpg">
89
St.Raphael’s H.S. School
</marquee>
</body>
</html>
90
St.Raphael’s H.S. School
91
St.Raphael’s H.S. School
92
St.Raphael’s H.S. School
93
St.Raphael’s H.S. School
a.setVisible(true);
this.setVisible(false);
a.setVisible(true);
this.setVisible(false);
LOGIN:-
boolean option=false;
try
94
St.Raphael’s H.S. School
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost/pizzahut","root","tiger
");
while(rs.next()){
String u = rs.getString(1);
String p = rs.getString("password");
if(email.equals(u)&&p.equals(pass))
option=true;
this.setVisible(false);
o.setVisible(true);
if(option==false)
95
St.Raphael’s H.S. School
{
JOptionPane.showMessageDialog(null,"wrong ");
jTextField1.setText("");
jPasswordField1.setText("");
rs.close();
stmt.close();
con.close();
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());}
CLEAR:-
jTextField1.setText("");
jPasswordField1.setText("");
96
St.Raphael’s H.S. School
SAVE:-
try{
97
St.Raphael’s H.S. School
String email= jTextField3.getText();
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost/pizzahut","root","
tiger");
String sql="insert into register values('"+ name + "', '"+city + "' , '" +
pass + "' , '"+ add +"' , '"+ email +"' , '"+ mob + "' );";
Statement stmt=con.createStatement();
stmt.executeUpdate(sql);
JOptionPane.showMessageDialog(null,"RECORD SAVED");
this.setVisible(false);
m.setVisible(true);
con.close();
stmt.close();
jTextField1.setText("");
}catch(Exception e)
JOptionPane.showMessageDialog(null,e);
98
St.Raphael’s H.S. School
}
CLEAR:-
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField5.setText("");
jPasswordField1.setText("");
99
St.Raphael’s H.S. School
PIZZAS:-
pizzas p =new pizzas();
this.setVisible(false);
p.setVisible(true);
100
St.Raphael’s H.S. School
CONFIRM ORDER:-
bill a=new bill ();
a.setVisible(true);
this.setVisible(false);
import java.sql.*;
try{
101
St.Raphael’s H.S. School
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost/pizzahut","root","
tiger");
Statement stmt=con.createStatement();
stmt.executeUpdate(sql);
con.close();
stmt.close();
catch(Exception e)
JOptionPane.showMessageDialog(null,e);
jButton1:-
String name="TOMATO PIZZA";
int price=250;
save(name,price);
102
St.Raphael’s H.S. School
jButton2:-
String name="ULTIMATE PANEER";
int price=250;
save(name,price);
jButton3:-
int price=300;
save(name,price);
jButton4:-
String name="EXOTICA";
int price=400;
save(name,price);
jButton5:-
String name="ULTIMATE PANEER";
int price=250;
save(name,price);
103
St.Raphael’s H.S. School
jButton6:-
String name="FIERY RIDE";
int price=250;
save(name,price);
jButton7:-
String name="DOUBLE CHEESE PIZZA";
int price=400;
save(name,price);
jButton8:-
String name="TANDOORI PIZZA";
int price=350;
save(name,price);
jButton9:-
String name="CHEESY OLIVE PIZZA";
int price=250;
save(name,price);
104
St.Raphael’s H.S. School
GENERATE BILL:-
int count=1;
try
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost/pizzahut","root","tiger
");
105
St.Raphael’s H.S. School
Statement stmt= con.createStatement();
DefaultTableModel d=(DefaultTableModel)jTable1.getModel();
d.getDataVector().removeAllElements();
while(rs.next()){
String n=rs.getString(1);
int p=rs.getInt(2);
DefaultTableModel t=(DefaultTableModel)jTable1.getModel();
Object[] a={n,p};
t.addRow(a);
int rows=jTable1.getRowCount();
int tp=0;
for(int row=0;row<rows;row++)
String total=(String)(""+jTable1.getValueAt(row,1));
tp+=Integer.parseInt(total);
jTextField7.setText(""+tp);
rs = stmt.executeQuery(sql1);
rs.last();
rs.previous();
if(rs.next())
count=rs.getInt(1);
count++;
jTextField2.setText(""+count);
else
jTextField2.setText(""+count);
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());}
SAVE:-
try{
107
St.Raphael’s H.S. School
int rows=jTable1.getRowCount();
boolean flag=false;
for(int row=0;row<rows;row++)
String pname=(""+jTable1.getValueAt(row,0));
int price=Integer.valueOf(""+jTable1.getValueAt(row,1));
int totalprice=Integer.parseInt(jTextField7.getText());
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost/pizzahut","root","
tiger");
String sql="insert into save values('"+ billno + "', '"+name + "' , '" + add +
"' , '"+ phno +"','"+ pname + "', "+price + " , " + totalprice + ");";
Statement stmt=con.createStatement();
stmt.executeUpdate(sql);
flag=true;
if(flag==true)
108
St.Raphael’s H.S. School
{
JOptionPane.showMessageDialog(null,"RECORD SAVED");
stmt.executeUpdate(sql1);
this.setVisible(false);
m.setVisible(true);
catch(Exception e)
JOptionPane.showMessageDialog(null,e);
109
St.Raphael’s H.S. School
110