Class 12 IP Practical File
Class 12 IP Practical File
PRACTICAL–ASSIGNMENTS
FRAME No. 1: A CALCULATOR
2
FRAME No. 3:
Objective: To calculate the total marks, percentage and grades on the basis of percentage
as given below.
Percentage Grades
>=90 A+
>=80 A
>=70 B
>=60 C
>=50 D
>=40 E
<40 F
3
Experiment No. 4:
Objective: Understanding and using the Radio Button in Real-life application to determine
the selection of choice and calculations accordingly.
Task: Develop a Billing application for Happy Shoping- A retail chain involved in sales
of Readymade garments. The happy Shoping offers discount to its members
holding Platinum, Gold and Silver card.
The 10% discount is given to Platinum card, 8% to Gold Card and 5% to Silver
Card holders on sales amount.
4
Experiment No. 5:
Objective: Understanding and using the Radio Button in Real-life application to determine the
selection of choices and calculations accordingly.
Task: The Entertainment Paradise- A theater in Delhi wants to develop a computerized
Booking System. The proposed Interface is given below. The theater offers different
types of seats. The Ticket rates are-
Stalls- Rs. 625/-, Circle- Rs.750/-, Upper Class- Rs.850/- and Box- Rs.1000/-.
A discount is given 10% of total amount if tickets are purchased on Cash. In case of
credit card holders 5% discount is given.
5
Experiment No. 6:
Objective: To check whether the given user id and password is correct or not.
6
Experiment No. 7:
Objective: Displaying images on a Label and Text Area control.
Task: Develop an e-Learning application with images and text information as per
given screen shot.
7
Experiment No. 8: (Problem 4.1 Page 165)
Objective: When a user selects a colour from list, the background of the appropriate
control should be changed.
Experiment No. 9:
Objective: Understanding and use of Nested loops and Text Area control.
Task: Develop a Java application to print a Pattern for given character and steps, as
per given screen shot.
8
Experiment No. 10:
Objective: Understanding the use of loops and mathematical operations.
Task: Develop an application to compute the sum of digits for given number.
9
Experiment No. 11:
Objective: Understanding the use of User-defined methods in the application.
Task: Develop an application to compute the Factorial and Checking Prime for a given
number, using custom methods. A method named factorial() and CheckPrime()
along with suitable parameters are called when Get Factorial and Check Prime
button is pressed respectively.
10
Experiment No. 12:
Objective: To concate two strings.
11
Experiment No. 15:
Objective: Demonstration of use of Combo Box through code.
12
Experiment No. 16:
Objective: Demonstration of use of List Dynamically through code.
Task: Develop an application as per given screen shot to Add , Remove the given
members of list and display the selected item in a text field using List control.
13
Experiment No. 17: (Problem 1, Page 269)
Objective: Design a data connectivity application that fetches data from EMPL table and
has an interface.
14
FRAME No. 19:
Objective:
Design a JAVA application to navigate records in Student Table with following assumption.
Database Name : School (created in MySQL)
Table Name: Student (with few test records)
Table Structure : (Roll Integer , Name Char(3), Class Integer )
Password for MySQL: tiger
Student Record
Roll No
Name
Class
Coding:
15
/*Code to connect MySQL Database when application loads*/
try{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection(DB,"root","tiger");
stmt=con.createStatement();
rs=stmt.executeQuery("select roll,name,class from student");
16
private void BtnNextActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
// Coding for Button Next
try{
rs.next() ;
if (rs.isAfterLast())
rs.first();
TxtRoll.setText(""+rs.getInt("roll"));
TxtName.setText(""+rs.getString("name"));
TxtClass.setText(""+rs.getInt("class"));
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,"Error!!!");}
}
}
});
}
17
FRAME No. 20:
Objective: Understanding the Web Page and use of different Tags and attributes.
<HTML>
<HEAD>
<TITLE> Computer Viruses</TITLE>
</HEAD>
<BODY BGCOLOR= #00ffff Topmargin=40 leftmargin=40>
<BASEFONT SIZE=3 FACE="Arial">
<IMG src="photo1.jpg" width="78" height="46" align="left">
<H1> What is Computer Virus?</H1>
<p align=left> A <b>virus</b> is basically an <i>executable file</i> that is designed
such that it is able to infect documents, has ability to survive by <u>replicating</u>
itself.<br> Usually to avoid detection, a virus disguises itself as a legitimate program that a
user would not normally suspect to be virus. </p>
<H2> Whar Virus can do? </H2>
<p> <font size=5 color= #ff0000 >Viruses </font>are designed to corrupt or delete data
on the hard disk, i.e. on the FAT (File Allocation Table).</p>
<H2> Types of Virus </H2>
<hr size=6 width=100% noshade>
<Font color= Maroon>
<p> Boot Sector Viruses </p>
<p> File or Program Viruses</p>
<a href="http://www.google.com/" ><font color="#ffff00" size=3> Get more on
Google.com</font></a>
</BODY>
</HTML>
18
FRAME No. 21:
Objective: Understanding the Web Form and use of different components to design
an interactive form.
Name :
Gender: Male Female
E-mail :
Stream: Science
Comment:
Submit Clear
<html>
<head><title> My page </title> </Head>
<body>
<H1> <U>ADMISSSION ENQUIRY FORM </u></h1>
<Form method=Post action= "maoilto:[email protected]">
<b>Name </b> <Input type=Text name="st_name"><br>
<b>Gender </b>
<Input type=Radio name="gender" value="Male"> Male
<Input type=Radio name="gender" value="Female"> Female<Br>
</b>E-mail </B><Input type=Text Name ="email“> <br>
Stream <SELECT name="stream">
<Option value="Science"> Science </Option>
<Option value="Commerce"> Commerce </OPTION>
<Option value="Arts"> Arts </Option>
</SELECT> <Br>
Comment<Br>
<TextAREA name="comment" Rows=5 cols=50> </TEXTAREA><br>
<INPUT Type=Submit Value ="Send">
<INPUT Type=Reset Value ="Clear">
</Form>
</body>
</html>
19
FRAME No. 22
Objective: Understanding the use of MySQL queries.
6 Add one column State of data type VARCHAR and size 30 to table DEPT
Ans: alter table DEPT
Add(state varchar(30));
20
Ans: create table emp
(EmpID integer primary key,
EmpName varchar(30) not null,
Designation char(10),
DOJ date,
Sal integer check(sal>1000),
Comm integer,
DeptID integer,
Foreign key(DeptID) references DEPT(DeptID) );
EMP
9 Write a query to display EmpName and Sal of employees whose salary are greater
than or equal to 2200
Ans: select empname, sal
from emp
where sal>=2200;
10 Write a query to display details of employees who are not getting commission.
Ans: select *
from emp
where comm is NULL;
11 Write a query to display employee name and salary of those employees who don’t
have their salary in range of 2500 to 4000.
Ans: select empname, sal
From emp
Where sal not between 2500 and 4000;
21
12 Write a query to display the name of employee whose name contains “A” as third
alphabet in Ascending order of employee names.
Ans: select empname
From emp
Where empname like “ A%”
Order by empname;
13 Display the sum of salary and commission of employees as “Total Incentive” who
are getting commission
Ans: select sal+comm As “Total Incentive”
From emp
where comm is not NULL;
14 Show the average salary for all departments with more than 5 working people.
Ans: select avg(sal)
From emp
Group by deptid
Having count(*)>5;
22
21. Display the name of Employees who is working in SALES department.
Ans: select empname
From emp, dept
Where deptName=”SALES” and emp.DeptID=dept.DeptID;
29. Delete all the records who is working as “SALESMAN” and salary more than
1500.
Ans: delete from emp
Where designation=” SALESMAN” and sal>1500;
30. Set the commission as 100 who are not getting any commission.
Ans: update emp
Set comm= 100
Where comm Is NULL;
23