Xii Sci It-Practicals Exp1 To 13
Xii Sci It-Practicals Exp1 To 13
Xii Sci It-Practicals Exp1 To 13
1. Pune Shanivarwada
4. Delhi
Coding:
Tourist.html
<!Doctype html>
<html>
<head>
<title>
Tourist place </title>
<style>
section{backgroud-color:pink;width:50%height=50%;float:right}
aside{width=50%;float:left}
ol{font-style:italic;font-size:15pt}
ul{font-weight:bold;font-size:20pt}
</style>
</head>
<body>
<header style="background-color:skyblue;height:100pt">
<h1 align=center>Tourist places </h1>
</header>
<br>
<aside>
<h3>city</h3>
<ol>
<li>pune</li>
<li>Banglore</li>
<li>Hedrabad</li>
<li>Delhi</li>
</ol>
</aside>
<section>
<h3>Tourist place in pune</h3>
<ul>
<li>Shaniwarpada</li>
<li>Kelkar musiem</li>
<li>Sinhgad fort</li>
<li>aga khan places</li>
</ul>
</section>
</body>
</html>
Practical-3:
Aim: SOP 5 : Use of Audio on web PAGES using HTML5.
Create a webpage named audio.html to set an audio file in web page with controls such
that it uses html 5 elements. The AUDIO file must play as soon as the web page loads in
browser and it will start over again, every time when it is completed.
Create another web page named audio1.html which provides multiple source file formats
for the same audio file that plays a sound automatically with controls. The browser should
display the message with appropriate attribute, when audio file is not supported by
browser. The code must incorporate the list of sound files formats (like WAV, MP3 or ogg
etc).
Code: Audio.html
<!DOCTYPE html>
<html>
<head>
<title>Single Audio with controls </title>
</head>
<body>
<h1 aling=center> Audio file with controls </h1>
<audio controls autoplay loop="-1">
<source src="sample.mp3" type="audio/mpeg">
</audio>
</body>
</html>
Audio1.html
<!DOCTYPE html>
<html>
<head>
<title>Multiple Audio Files with controls </title>
</head>
<body>
<h1 align=center>Multiple Audio file with controls </h1>
<h2>The text between the audio tags will only be displayed in browsers that do not support
the audio elembent </h2>
<h3> List of sound file formats </h3>
<ol>
<li>mp3 - audio/mpeg </li>
<li>ogg - audio/ogg </li>
<li>wav - audio/wav </li>
</ol>
<audio controls autoplay>
<source src="sample.mp3" type="audio/mpeg">
<source src="sample.wav" type="audio/wav">
<source src="sample.ogg" type="audio/ogg">
Your browser does not support the audio
element
</audio>
</body>
</html>
Audio.html
Audio1.html
Practical-4
SOP 6: Use of video on web page using HTML 5
Create a webpage named video.html to display a video file on web page and plays
automatically with controls. The dimension of video area should be 150 * 150 pixels.
Create another webpage which provide multiple source file formats for the same video file
that plays a video automatically with controls. The dimension of video area should be
100*100 pixels. The browser should display the message with appropriate attribute when
video file is not supported by browser. The code must incorporate the list of video file
formats (like webM, MP4 or ogg etc.)
Coding:
Video.html
<!Doctype html>
<HTML>
<HEAD>
<TITLE>
Single Video File on Web Page with controls </title></head>
<body>
<h1 align="center"> Single Video File on Web page with controls</h1>
<video controls src="sample1.mp4" width=150 height=150 loop=-1 autoplay=true>
</video>
</body>
</html>
Video1.html
<!Doctype html>
<HTML>
<HEAD>
<TITLE>
Multiple Video File on Web Page with controls </title></head>
<body>
<h1 align="center"> Multiple Video File on Web page with controls</h1>
<h2>The text between the video tags will only be diplayed in browsers that do not support
the video element </h2>
<h3> List of video files formats </h3>
<ol>
<li>mp3 -video/mp3g </li>
<li>ogg -video/ogg </li>
<li>WebM -video/webM </li>
</ol>
<video controls width=150 height=150 loop=-1 autoplay=true>
<source src="sample1.mp4" type=video/mp4>
<source src="sample1.mpg" type=video/mpg>
<source src="sample2.avi" type=video/avi>
</video>
</body>
</html>
Practical-5
SOP 7 : Navigation on an image using Client side image mapping in web page using HTML 5.
Create a webpage named imagemap. Html with an inserted image having jpeg, png or gif
extension. Create 3 different shapes (like rectangle, Circle and polygon) which do not
overlap. Note the co-ordinates making use of Ms-paint/GIMP. Each shape should be
mapped or navigate with a different URL that should navigate to a local webpage.
Index .html
<!Doctype html>
<html>
<head>
<title>Client Side Image Mapping</title>
</head>
<body>
<h1 align="center">Clinet Side Image Mapping </h1>
<img src="collegeimage.jpeg" width=700 height=600 usemap="#imagemap">
<map name="imagemap">
<area shape="rect" coords="77,57,269,190" href="page1.html" alt="google">
<area shape="circle" coords="555,227,90" href="page2.html" alt="rediffmail">
<area shape="poly" coords="122,246,387,423,115,447" href="page3.html" alt="mahahsc">
</map>
</body>
</html>
Page1.html
<html>
<head>
<title>Page 1</title>
</head>
<body>
<h1 align="center">This is page1 file </h1>
</body>
</html>
Note:
Same like Page1.html create page2.html and page3.html for client side linking local web
page
Practical 6:
Steps:
1. The website is https://stpeterseducation.com/
2. The software used is SEOptimer
3. The four suggestions to improve website
It is the technique for designing and developing a website to be rank high in search
engine reults
It is subset of SEM (Search Engine Marketing)
SEO is useful in increasing number of visitors in a website
JAVASCRIPT
Practical-7
SOP1 : Create a web page in HTML having a white background and two button objects.
Write code using JavaScript such that when the mouse is place over the first button object
without clicking, the color of the background of the page should change after every
seconds. There should at least be 7 different and visible distinct background colors
excluding the default color. When the second button object is clicked, appropriate message
should be displayed in Browsers status bar.
Create another web page using JavaScript where the background color changes
automatically after every seconds. This event must be triggered automatically after the
page gets loaded in the browser. There should at least be 7 different and visibly distinct
background colors. When the page is unloaded, the appropriate alert message should be
displayed.
Coding.
Color1.html
<!Doctype html>
<html>
<head>
<title>Background Colors</title>
</head>
<body>
<h1 align="center">7 Different & Visibly distinct background colors </h1>
<form name="frm1">
<center>
<input type="button" name="btncolor" value="Change Colors" onMouseOver="f1()">
<input type="button" name="btnmsg" value="Message Display" onClick="msg()">
</form>
</body>
<script type="text/javascript">
function f1()
{
document.bgColor="red";
window.setTimeout("f2()",1500);
}
function f2()
{
document.bgColor="green";
window.setTimeout("f3()",1500);
}
function f3()
{
document.bgColor="pink";
window.setTimeout("f4()",1500);
}
function f4()
{
document.bgColor="orange";
window.setTimeout("f5()",1500);
}
function f5()
{
document.bgColor="skyblue";
window.setTimeout("f6()",1500);
}
function f6()
{
document.bgColor="violet";
window.setTimeout("f7()",1500);
}
function f7()
{
document.bgColor="aqua";
window.setTimeout("f1()",1500);
}
function msg()
{
windows.status="Display of 7 different colors";
}
</script>
</html>
Color2.html
<!Doctype html>
<html>
<head>
<title>Background Colors</title>
</head>
<body onLoad="f1()" onUnload="msg()">
<h1 align="center">7 Different & Visibly distinct background colors </h1>
</body>
<script type="text/javascript">
function f1()
{
document.bgColor="red";
window.setTimeout("f2()",1500);
}
function f2()
{
document.bgColor="green";
window.setTimeout("f3()",1500);
}
function f3()
{
document.bgColor="pink";
window.setTimeout("f4()",1500);
}
function f4()
{
document.bgColor="orange";
window.setTimeout("f5()",1500);
}
function f5()
{
document.bgColor="skyblue";
window.setTimeout("f6()",1500);
}
function f6()
{
document.bgColor="violet";
window.setTimeout("f7()",1500);
}
function f7()
{
document.bgColor="aqua";
window.setTimeout("f1()",1500);
}
function msg()
{
windows.status="Display of 7 different colors";
}
</script>
</html>
Practical-8
SOP 2: Create JavaScript program for the following form validations. Make use of
HTML5 properties
1) NAME, ADDRESS, CONTACT number AND EMAIL ARE required fields of the form.
2) address field should show the hint VALUE which will DISAPPEAR when field gets focus
or key press event.
3) telephone number should be MAXimum 10 digit number only.
4) EMAIL field should CONTAIN VALID EMAIL ADDRESS, @ should APPEAR only once AND not
AT the beginning or AT end. it must CONTAIN AT LEAST one dot(.).
5) MAKE use of PATTERN ATTRIBUTE for EMAIL to ACCEPT LOWERCASE, UPPERCASE
ALPHABETS, digits AND specified symbols.
Code: Validation.html
<!Doctype html>
<HTML>
<HEAD>
<TITLE>E-mail form</TITLE>
</HEAD>
<body>
<form name="frm1">
Enter Name
<input type="text" name="t1"><br><br>
Enter Address<br>
<textarea name="t2" placeholder="Type your address here">
</textarea><br><br>
Enter telephone number
<input type="tel" maxlength="10"><br><br>
Enter Email Address
<input type="email" name="t3" pattern="[A-Z a-z]{5}-[@]{1}-[.]{1}"
placeholder="[email protected]"><br><br>
<input type="button" name="b1" value="submit" onClick="chk();">
</form>
<SCRIPT language="JavaScript">
function chk()
{
var x=frm1.t3.value;
var atpos=x.indexOf("@");
var lastat=x.lastindexOf("@");
var firstdot=x.indexOf(".");
var dotpos=x.lastIndexOf(".");
if(atpos<1||dotpos<atpos+2||dotpos+2>=x.length||firstdot<atpos||atpos<lastat)
{
alert("Not a valid email address");
frm1.t3.focus();
}
else
{
alert("Email address accepted");
return true;
}
}
</script>
</body>
</html>
Practical-9
SOP 5: Create a JavaScript program which compute the give Celsius
Temperature value by user into Fahrenheit Temperature value and display it.
Note that the Math.round() method is used, so that the result will be returned as an
integer.
Code: Temperature.html
<!Doctype html>
<html>
<body>
<h2>JavaScript Celcius to Fahrenhet</h2>
<p>Insert a number into one of the input fields below:</p>
<p><input id="c" onkeyup="convert('C')"> degrees Celsius</p>
<p><input id="f" onkeyup="convert('F')"> degrees Fahrenheit</p>
<p>Note that the <b>Math.round()</b> method is used, so that the result will be returned as
an integer.</p>
<script>
function convert(degree) {
var x;
if (degree == "C") {
x = document.getElementById("c").value * 9 / 5 + 32;
document.getElementById("f").value = Math.round(x);
} else {
x = (document.getElementById("f").value -32) * 5 / 9;
document.getElementById("c").value = Math.round(x);
}
}
</script>
</body>
</html>
Practical-10
SOP 6:Create JavaScript program which compute the average marks of students.
Accept six subject marks of student from user. Calculate average marks of student
which is used to determine the corresponding grades.
Range Grade
35 to 45 C
46 TO 60 B
61 TO 75 A
75 TO 100 O
Grade.html
<html>
<body>
<form name=frm1>
Enter Marks of English
<input type=”number” name=”t1”><br><br>
Enter Marks of Maths
<input type=”number” name=”t2”><br><br>
Enter Marks of Physics
<input type=”number” name=”t3”><br><br>
Enter Marks of Chemistry
<input type=”number” name=”t4”><br><br>
Enter Marks of IT
<input type=”number” name=”t5”><br><br>
</form>
<script type=”text/javascript”>
Function grade()
{
Var m1,m2,m3,m4,m5,a;
m1=frm1.t1.value;
m2=frm1.t2.value;
m3=frm1.t3.value;
m4=frm1.t4.value;
m5=frm1.t5.value;
a=(m1+m2+m3+m4+m5)/5;
alert(“Average Marks of student is”+a);
if(a>=75)
{
alert("Grade O");
}
else if(a>=60)
{
alert("Grade A");
}
else if(a>=45)
{
alert("Grade B");
}
else if(a>=35)
{
alert("Grade C");
}
else
{
alert("Grade D");
}
}</body>
</html>
output
PHP
SERVER SIDE SCRIPTING (PHP) 02 PRACTICALS
Practical-11
SOP1 : Write PHP program to check if a person is eligible to vote or not. The program should
include the following.
Minimum age required for vote is 18
Use PHP functions.
Use Decision making statement.
Coding:
Age.html
<!Doctype html>
<html>
<body>
<h1 align="center"> Person eligible to vote or not </h1>
<form method=post action="age.php">
Enter your age <input type=text name=age><br><br>
<input type=submit name=submit value="Check Eligible">
</form>
</body>
</html>
age.php
<?php
if(isset($_POST['submit']))
{
$age=$_POST['age'];
if($age>=18)
echo "<br><br>Your are eligible to vote";
else
echo "<br><br>Your are not eligible to vote";
}
?>
Practical 12:
SOP 2 : Write a PHP function to count the total number of vowels (a,e,i,o,u)
from the string. Accept a string by using HTML form.
Vowel.html
<html>
<body>
<h1 align=center> String function </h1>
<form method=post action=”vowel.php”>
Enter string
<input type=text name=str> <br><br>
<input type=submit name=submit value=”count vowels”>
</form>
</body>
</html>
vowel.php
<?php
If(isset($_POST[‘submit’]))
{
$str=strtolower($_POST[‘str’]);
$vowels=array(‘a’,’e’,’i’,’o’,’u’);
$len=strlen($str);
$num=0;
for($i=0;$i<$len;$i++)
{
If(in_array($str[$i],$vowels))
{
$num++;
}
}
echo “Number of vowels : .$num”;
}
?>
Practical 13:
SOP 5:
Write a PHP program to save marks of English, Hindi, Marathi, Maths and Information
Technology in an array. Display marks of individual subject along with total marks
and percentage.
Marks.php
<?php
$a=array(60,78,74,85,96);
$t=0;
$x=0;
$c=count($a);
for($x=0;$x<$c;$x++)
{