Вы находитесь на странице: 1из 16

PRACTICAL-2

Aim: Write HTML program by using list tags


a) ordered list
b) unordered list
c) definition list

Source code

<html>
<head>
<title>ordered+unordered+defintion list</title>
</head>
<body>
<p>Ordered list defines a list in which order matters.Ordered lists can have a variety of types.</p>

<ol>
<li type="a">Lowercase Letters</li>
<li type="A">Uppercase Letters</li>
<li type="i">Lowercase roman numerals</li>
<li type="I">Uppercase roman numerals</li>
<li type="1">Arabic numerals</li>
</ol>

<p>Unordered lists are used for lists of items in which the ordering is not specific.</p>

<ul type="square">
<li>First item bullet shape set by ul</li>
<li type="disc">Disc Item</li>
<li type="circle">Circle Item</li>
<li type="square">Square Item</li>
</ul>

<p>A definition list is a list of terms paired with associated definitions.</p>

<dl>
<dt>Computer</dt>
<dd>An electronic device that takes some raw data, store it, process it and gives some
output.</dd>
</dl>

</body>
</html>
OUTPUT
PRACTICAL-3
Aim: Create a web page in HTML using frames

FRAME.HTML
<HTML>
<HEAD>
<TITLE>FRAME EXAMPLE</TITLE>
</HEAD>
<FRAMESET COLS="50%, 50%" >
<FRAMESET ROWS="50%, 50%">
<FRAME SRC="link1.html" />

<FRAME SRC="link2.html" />


</FRAMESET>
<FRAMESET ROWS="50%, *">
<FRAME SRC="link3.html" />
<FRAME SRC="link4.html" />
</FRAMESET>
</FRAMESET>
</HTML>

LINK1.HTML
<html>
<head></head>
<body>
<a href="link1.html" target="_top">
<img src="C:\miiiiiiiiii.JPG">
</a>

LINK2.HTML
<html>
<head></head>
<body>
<a href="link2.html" target="_top">
<img src="C:\baby pic.jpg"/>
</a>

LINK3.HTML
<html>
<head></head>
<body>
<a href="link3.html" target="_top">
<img src="C:\cute 2.JPG">
</a>

LINK4.HTML
<html>
<head></head>
<body>
<a href="link4.html" target="_top">
<img src="C:\cute4].JPG">
</a>
OUTPUT
PRACTICAL-4

Aim: Write a HTML program to create a table using Tag <table>

Source code

<html>
<head>
<title> Table</title>
</head>
<body>
<font face="times new roman" size="6">
<table border="10" bordercolor=black cellspacing="6" cellpadding="8" align="center">
<tr align="center">
<td> Sl.No</td>
<td>Roll no</td>
<td> Name</td>
<td>Marks1</td>
<td> Marks2</td>
</tr>
<tr align="center">
<td>1.</td>
<td>8pgc18</td>
<td> vineeta</td>
<td>20</td>
<td>20</td>
</tr>
<tr align="center">
<td>2.</td>
<td>8pgc05</td>
<td> karishma</td>
<td>20</td>
<td>20</td>
</tr>
</table>
</font>
</body>
</html>
OUTPUT
PRACTICAL-5

Aim: To create a form where a end user fill up a form which is related to his/her personal details; fields
required are user name, password, Fname, Lname, email id,telephone no., address, sex, country, state and at
the end there are two buttons.Submit Reset.

Source code
<html>
<head>
<title> Create a form</title>
</head>
<body>
<form>
<table border="5" bordercolor=black cellspacing="2" cellpadding="2" align ="center">
<tr align ="center">
<td> Name</td>
<td><input type="text" name="id" size="20"></td>
</tr>
<tr align ="center">
<td> password</td>
<td><input type="password" name="nn" size="20" maxlength="40"></td>
</tr>
<tr align ="center">
<td> Fname</td>
<td><input type="text" name="id" size="20" ></td>
</tr>
</tr>
<tr align ="center">
<td> Lname</td>
<td><input type="text" name="id" size="20" ></td>
</tr>
<tr align ="center">
<td>Address </td>
<td><textarea name="message"rows="3"cols="25"maxlenth="100" >
</textarea>
</td>

</tr>
<tr align ="center">
<td> Telephone no</td>
<td><input type="text" name="tel.no" size="20" ></td>
</tr>
<tr align="center">
<td>E-mail id</td>
<td><input type="text" name="id" size="20"></td>
</tr>
<tr align ="center">
<td> Sex</td>
<td>
<input type="radio" name="s" value="male">male

<input type="radio" name="s" value="female">female


</td>
</tr>
<tr align ="center">
<td> Country</td>
<td><input type="text" name="id" size="20" ></td>
</tr>
<tr align ="center">
<td> State</td>
<td><input type="text" name="id" size="20" ></td>
</tr>
</table><br>

<center>
<input type=submit name submit value=submit>
<input type=reset name reset value=clear>
</form>
</body>
</html>

OUTPUT
PRACTICAL-6

Aim: To write a program HTML for inline cascading style sheet.

Source code

<HTML>
<HEAD>
<TITLE>INLINE CSS</TITLE>
</HEAD>
<BODY>
<P style="font-size:20pt;color:red;text-indent:0.5in;margin-left:50px;margin-right:50px;">A style sheet
associates look or formatting to a particular piece of content in a document.</p>
<h1 style="font-size:48pt;font-family:arial;color:green;text-align:center;">CSS inline</h1>
</body>
</html>

OUTPUT
PRACTICAL-7

Aim: To show hyperlinks on text used in an external document style sheet

Source code:

<html>
<head>
<title>style sheet linking example</title>
<link rel="stylesheet" href="sitestyle.css" type="text/css"/>
</head>
<body>
<h1>HTML with style</h1>
<p> Cascading style sheet as defined by the
<a href="http:/www.w3.org">W3C</a>provides
powerful page layout facilities.</p>
</body>
</html>

OUTPUT
PRACTICAL-8
Aim: To create a simple web page using XML.

Source code

<html>
<head><style>
invoice * {display:list-item;}
invoice:before{content:"Invoice:"attr(d);}
date:before{content:"Date:"}
date{font:italic 10pt arial;}
company{font-weight:bold;}
company[type="from"]:before{cotent:"From:"}
company[type="to"]:before{content:"To:"}
price:before{contet:"Price:"}
gst:befor{content:"GST:"attr(val);}
payed:before{content:"Payed."}
</style></head>
<body>
Text before the Data Island.
<invoice id="1523">
<date>Oct 14,2008</date>
<company type="from">Company A</company>
<!--This is a comment-->
<company type="to">Compnay B</company>
<price currency="A'b'c">1234.56<gst currency='A"b"c' val="60.05"/>
</price>
<payed/>
</invoice>
Text after the Data Island.
</body></html>

OUTPUT
PRACTICAL-9
Aim: To write a program for XML data in external files.

Source code

Data.xml
<invoices>
<invoice id="005">
<date>14-oct-2008</date>
<from>Company A</from>
<to>Company B</to>
<price>123.45</price>
</invoice>
<invoice id="006">
<date>13-Oct-2008</date>
<from>Company A</from>
<to>Company C</to>
<price>54.345</price>
</invoice>
</invoices>

Xml12.xml
<html>
<head></head>
<body>
<xml id="invs"src="data.xml"></xml>
<table border datasrc="#invs">
<thead>
<tr><th>Date<th>From<th>To<th>Price</tr>
</thead>
<tbody>
<tr>
<td><span datafld="data"></span></td>
<td><span datafld="from"></span></td>
<td><span datafld="to"></span></td>
<td><span datafld="price"></span></td>
</tr>
</tbody>
</table>
</body></html>
OUTPUT
PRACTICAL-10

Aim: Demonstrate exception handling in Java.

1.3 CODING:
class Demo{
public static void main(String args[])
{
int a=5;
int b=0;
int c;

try{
c=a/b;
}
catch(Exception e)
{
System.out.println("Error:"+e);
}
}
}

OUTPUT
PRACTICAL-11

Aim: Demonstrate the Implementation of Inheritance in Java.

1.4 CODING:
class Student{
int rollNumber;
void getNumber(int n)
{
rollNumber=n;
}
void putNumber()
{
System.out.println("Roll Number: "+rollNumber);
}}
class Test extends Student{
float part1,part2;
void getMarks(float m1,float m2)
{
part1=m1;
part2=m2;
}
void putMarks()
{
System.out.println("Marks Obtained");
System.out.println("Part1 = "+part1);
System.out.println("Part2 = "+part2);
}}
class Results extends Test{
float total;
void display()
{
total=part1+part2;
putNumber();
putMarks();
System.out.println("Total Marks: "+total);
}}
class Hybrid{
public static void main(String args[]){
Results student1=new Results();
student1.getNumber(1234);
student1.getMarks(27.5F,33.0F);
student1.display();
}}
OUTPUT

Вам также может понравиться