EX - NO:1 Book Details: To Create A Book Details For Various Books, Author, Year, and Price Using XML and Desingning To Css
EX - NO:1 Book Details: To Create A Book Details For Various Books, Author, Year, and Price Using XML and Desingning To Css
EX - NO:1 Book Details: To Create A Book Details For Various Books, Author, Year, and Price Using XML and Desingning To Css
NO:1
BOOK DETAILS
AIM:
To create a book details for various books,author,year,and price using xml and
desingning to css.
ALGORITHM:
STEP 3 :To write a XML code for various books,authors,year and price.
STEP 5 : to save the xml document in the book.xml and CSS file is save in Rule.css.
BOOK.XML
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<title>Wings of fire</title>
<year>2019</year>
<price>330</price>
</book>
<book>
<title>Quantantative Aptitude</title>
<author>R.S Agarwal</author>
<year>2018</year>
<price>600</price>
</book>
<book>
<author>Gandiji</author>
<year>1934</year>
<price>580</price>
</book>
<book>
<title>mahabaratham</title>
<author>Viliputurar</author>
<year>1567</year>
<price>750</price>
</book>
<book>
<title>Ramayana</title>
<author>Vanmeegi</author>
<year>1276</year>
<price>300</price>
</book>
</books>
RULE.CSS
books
color:white;
width:100%;
background-color:powderblue;
head
text-align:center;
color:darkblue;
font-size:40px;
background-color:orange;
head,title,author,year,price
display:block;
}
title
text-align:center;
font-size:30px;
font-weight:bold;
color:green;
author,year,price
color:brown;
font-size:25px;
text-align:center;
}
OUTPUT:-
EX.NO:2
PRODUCT DETAILS
AIM:
ALGORITHM:
STEP3:To write a XML code for various products like pen,pencil,milk and its
STEP 5 : to save the xml document in the prg2.xml and CSS file is save in products.css.
Prg2.xml
<?xml version="1.0" encoding="UTF-8"?>
<products>
<name>Milk</name>
<price>80</price>
<stock>4 Litre</stock>
<country>Denmark</country>
</product>
<name>Saree</name>
<price>10000</price>
<stock>5</stock>
<country>India</country>
</product>
<name>Pen</name>
<price>100</price>
<stock>20</stock>
<country>Jordan</country>
</product>
<name>Fan</name>
<price>1500</price>
<stock>5</stock>
<country>Australia</country>
</product>
<name>Fridge</name>
<price>1225</price>
<stock>3</stock>
<country>America</country>
</product>
</products>
Products.css
products
font-size:100%;
margin:0.5em;
font-family: Verdana;
display:block
product
display:block;
margin:0.5em;
padding:0.5em;
background-color:whitesmoke;
display:block
name
color:red;
text-decoration: underline;
price
color:green
stock
color:brown
country
color:blue
product#p4 {text-align:center}
product[class=special] {background-color:green}
product[class=bca] {background-color:orange}
product[class=cs] {background-color:Gold}
product[class=it] {background-color:powderblue}
OUTPUT:-
EX.NO:3
OCEANS DETAILS
AIM:
To create a Oceans details for various Oceans in the world and area and depth
of the Oceans in xml source code and designing to css source code.
ALGORITHM:
STEP3:To write a XML code for various Biggest Oceans name,area of the ocean and its
depth.
STEP 5 : to save the xml document in the prg3.xml and CSS file is save in Oceans.css.
Prg3.xml
<?xml version="1.0"?>
<!DOCTYPE planet>
<planet>
<ocean>
<name>Arctic</name>
<area>13,000</area>
<depth>1,200</depth>
</ocean>
<ocean>
<name>Atlantic</name>
<area>87,000</area>
<depth>3,900</depth>
</ocean>
<ocean>
<name>Pacific</name>
<area>180,000</area>
<depth>4,000</depth>
</ocean>
<ocean>
<name>Indian</name>
<area>75,000</area>
<depth>3,900</depth>
</ocean>
<ocean>
<name>Southern</name>
<area>20,000</area>
<depth>4,500</depth>
</ocean>
</planet>
Oceans.css
planet:before
display: block;
width: 8em;
font-weight: bold;
font-size: 100%;
content: "Oceans";
background-color: #cdf;
planet
display: block;
background-color: white;
ocean
{
display: block;
margin-bottom: 1em;
name
display: block;
font-weight: bold;
font-size: 150%;
area
display: block;
area:before
area:after
depth
display: block;
depth:before
{
content: "Mean depth: ";
depth:after
OUTPUT:-
EX.NO:4
PAITENT DETAILS
AIM:
ALGORITHM:
STEP3:To write a XML code for various paitents and his name,age,
STEP 5 : to save the XSL document in the prg4.xml and CSS file is save in paitent.xsl
Prg4.xml
<?xml version="1.0" encoding="utf-8"?>
<patients>
<patient>
<name>
<mname> s</mname>
<lname> Srinivas</lname>
</name>
<age> 80</age>
<insurance type="Primary">
<id> 10 </id>
<address> Yeshwanthpura</address>
</insurance>
<insurance type="Secondary">
<id>20 </id>
</insurance>
<medproblems> Bp </medproblems>
<drugallergy>None</drugallergy>
</patient>
<patient>
<name>
<fname> rakshith </fname>
<mname> gm</mname>
<lname> gowda</lname>
</name>
<age> 41</age>
<insurance type="Primary">
<id> 111</id>
<address> jp nagar
</address>
</insurance>
<insurance type="Secondary">
<id>112 </id>
</insurance>
<drugallergy>Cold</drugallergy>
</patient>
<patient>
<name>
<mname> g</mname>
</name>
<age> 42</age>
<roomnumber> 422 </roomnumber>
<insurance type="Primary">
</insurance>
<insurance type="Secondary">
<id> 114</id>
<address> jp</address>
</insurance>
<medproblems>cancer </medproblems>
<drugallergy>Swelling</drugallergy>
</patient>
<patient>
<name>
<mname> v</mname>
<lname>gowda</lname>
</name>
<ssn> 103</ssn>
<age> 41</age>
<insurance type="Primary">
</insurance>
<insurance type="Secondary">
<id> 115</id>
<address> j.p.v nagar</address>
</insurance>
<drugallergy>None</drugallergy>
</patient>
</patients>
paitent.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:template match="/">
<html>
<body>
<table border="2">
<tr bgcolor="orange">
<th>Medical problem</th>
<th>Drug Allery</th>
</tr>
<xsl:for-each select="patients/patient">
<tr>
<td> <xsl:value-of select="ssn"/> </td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:-
EX.NO:5
STUDENT DETAILS
AIM:
To create a Xml DTD codes to write a full details of a student information and
designing with HTML Source code.
ALGORITHM:
STEP 5 : to save the XML document in the Student.xml and DTD file is save in
Student.dtd and to save a html source code for Student.html.
Student.xml
<?xml version="1.0"?>
<STUDENTS>
<STUDENT>
<STUDENTDATA>
<AGE> 20 </AGE>
</STUDENTDATA>
</STUDENT>
</STUDENTS>
Stuent.dtd
<?xml version="1.0"?>
<!ELEMENT ID (#PCDATA)>
"E:\XML1\STUDENT.dtd"">
<html>
</head>
<CENTER><TABLE BORDER="1">
<THEAD>
<TR>
<TH> ID </TH>
</TR>
</THEAD>
<TFOOT>
<TR>
</TFOOT>
<TR>
<TD>DILPKUMAR P</TD>
<TD>17USC004</TD>
<TD>20</TD>
</TR>
</TABLE></CENTER>
</body>
</html>
OUTPUT:-
EX.NO:6
ELECTRICITY BILL CALCULATION
AIM:
ALGORITHM:
STEP 3 : Design the input form using HTML and CSS and get
<head>
<center><title>Elelctricity bill</title>
</center>
</head>
<body>
Enter month:          
</form>
</body>
</html>
Bill.php
<?php
$consnum=$_POST["cnum"];
$consname=$_POST["cname"];
$month1=$_POST["month"];
$cmr1=$_POST["cmr"];
$pmr1=$_POST["pmr"];
$units=$cmr1-$pmr1;
if($units>0and $units<=100)
$up=3;
$up=5;
$up=6;
$up=9;
else if($units>1000)
$up=15;
$amount=$units*$up;
echo "electricity</br>";
echo "month:$month1<br>";
echo "units:$units<br>";
echo "amount:$amount<br>"; ?
OUTPUT:-
EX.NO:7
FACTORIAL USING RECURSIVE FUNCTIONS
AIM:
ALGORITHM:
STEP 3 : Design the input form using HTML and CSS and get the number
from user
STEP 4 : Write the PHP Code to find the factorial number using if statement
<body>
<H1>
<CENTER>FACTORIAL VALUE</CENTER>
</H1></BR>
Enter a number:
</br>
<BR>
</form>
</body>
</html>
Fact.php
<html>
<body>
<center><b>FACTORIAL NUMBER:</b><center>
<?php
echo fact($_POST["number"]);
function fact($n)
if($n==0)
return 1;
}
else
return $n*fact($n-1);
?>
</body>
</html>
OUTPUT:-
EX.NO:8
STUDENT MARKSHEET CREATION
AIM:
ALGORITHM:
STEP 3 : Design the input form using HTML and CSS and get student name,
marks as input
STEP 4 : Write the PHP Code to display the student name with marks and also
<body>
<center>
<h1>STUDENT MARKSHEET</h1>
</center>
<BR>
<BR>
<BR>
<center>
ENTER MY NAME:
<BR><BR>
</center>
</form>
</body>
</html>
marksheet.php
<HTML>
<BODY>
<CENTER>
<H1>MY UG MARKSHEET</H1>
<br>
<?php
$n=$_POST["name"];
$s1=$_POST["s1"];
$s2=$_POST["s2"];
$s3=$_POST["s3"];
$s4=$_POST["s4"];
$s5=$_POST["s5"];
$total=$s1+$s2+$s3+$s4+$s5;
$avg=($s1+$s2+$s3+$s4+$s5)/5;
echo "TOTAL:$total<BR></BR>";
echo "AVG:$avg<BR></BR>";
if(($s1>=50)&&($s2>=50)&&($s3>=50)&&($s4>=50)&&($s5>=50))
echo "RESULT:PASS";
else
echo "RESULT:FAIL";
?>
<BR>
</CENTER>
</BODY>
</HTML>
OUTPUT:-
EX.NO:9
EMPLOYEE PAYSLIP
AIM:
ALGORITHM:
STEP3 : Design the form using HTML and CSS and get empno , empname ,
STEP4: Write the PHP Code to Calculate the HRA, TA, DA , PF and Netpay
<html>
<body bgcolor="red">
</br></br>
</br></br>
<select name="m">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select></br></br>
Enter Basicpay:
</br></br>
</form>
</body>
</html>
Payslip.php
<html>
<head>
<h1 align="center">Payslip</h1>
</head>
<body bgcolor="pink">
<?php
$eno=$_POST["no1"];
$ename=$_POST["na1"];
$month=$_POST["m"];
$bp=$_POST["basic"];
$hra=$bp*0.12;
$da=$bp*0.14;
$pf=500;
$lic=500;
$np=$bp+$hra+$da-$pf-$lic;
?>
</html>
OUTPUT:-
EX.NO:10
ELIGIBLE TO VOTE OR NOT
AIM:
ALGORITHM:
STEP 3 : Design the input form using HTML and get name & age as
STEP 4 : Write the PHP Code to check whether the person is eligible to vote or
STEP 6 : Otherwise display that the person is not eligible to vote and calculate
the number of years he/she have to wait. Display the results in Screen
<html>
<head>
</head>
<body bgcolor="green">
</form>
</body>
</html>
eligible.php
<html>
<head>
</head>
<body bgcolor="pink">
<?php
$name=$_POST["n1"];
$age=$_POST["age"];
if ($age>=19)
else
$diff=19-$age;
?>
OUTPUT:-