Professional Documents
Culture Documents
WT Solution
WT Solution
WT Solution
Head:-
<html>
<body>
</body>
</html>
<html>
<body>
<link rel="stylesheet"type="text/css"href="q1.css">
<ul type="disk">
<li>furnishing
<li>home decor
<li>home improvement
</ul>
</body>
</html>
<html>
<body>
<link rel="stylesheet"type="text/css"href="q1.css">
<ul type="i">
<li>coookware
<li>kitchenware
<li>bakeware
<li>serveware
</ul>
</body>
</html>
CSS:-
body{background-color:pink}
h1{text-align:center;
color:black}
image:-
<html>
<body>
<link rel="stylesheet"type="text/css"href="q1.css">
</body>
</html>
Main:-
<html>
<frameset rows=10%,90%>
<frame src="q1.head1.html">
<frameset cols=40%,60%>
<frame src="img.html">
<frame src="q1.2col.html">
</html>
o/p
Q.2 Write HTML and CSS code to design a web page displaying list of hyperlinks. Use Inline style
sheet with appropriate attributes to display information of each frame for IT Industries in India.
Main:-
<html>
<head>
</head>
<frameset rows=10%,90%>
<frame src="q.2head.html">
<frameset cols=30%,70%>
<frame src="q21col.html">
</frameset>
<body>
<style="bgcolor:red;">
</body>
</html>
Head:-
<html>
<head>
</head>
<body>
<style>
body{background-color:pink; text-align:"center"}</style>
</body>
</html>
City:-
<html>
<body>
<b>City</b>
<ol type="1">
</body>
</html>
Pune:-
<html>
<body>
<b>Pune</b>
<ul type="disk">
<li>Infosys
<li>TCS
<li>Tech mahindra
<li>Persistent
</body>
</html>
o/p:-
var i = 0;
var path = new Array();
path[0] = "one.jpg";
path[1] = "two.jpg";
path[2] = "three.jpg";
function swapImage()
{
document.slide.src = path[i];
if(i < path.length - 1)
i++;
else
i = 0;
setTimeout("swapImage()",1000);
}
window.onload=swapImage;
</script>
</html>
Q.4 Write a JavaScript program to read a number from user, store its factor into the array and display
that array. (Handle onClick Event).
<html>
<body>
<script type="text/javascript">
function factors()
var i,no;
var no1=document.getElementById("no").value;
for(i=1;i<=no1;i++)
if(no1%i==0)
{
var fa=[i];
document.write(fa);
document.write("<br>");
return 0;
</script>
<form>
<pre>
<br>
</pre>
</form>
</body>
</html>
o/p:-
Q.5 Write HTML and CSS code to design a web page. Use Internal style sheet with appropriate
attributes to display information of each frame for Computer Application Department
Head:-
<html>
<head>
<title>head</title>
</head>
<font color="red">
</font>
</body>
</html>
Table:-
<html>
<head>
<title>table</title>
</head>
<body>
<table border="1" cellspacing="5" bgcolor="skyblue" bordercolor="red" cellpadding="10">
<tr>
<th>date</th>
<th>time</th>
<th>subject code</th>
<th>subject name</th>
</tr>
<tr>
<th>12/10/2015</th>
<th>101</th>
<th>PPA</th>
</tr>
<th>13/10/2015</th>
<th>102</th>
<th>MOE</th>
</tr>
<th>14/10/2015</th>
<th>103</th>
<th>BC</th>
</tr>
<th>15/10/2015</th>
<th>104</th>
<th>PM</th>
</tr>
<th>16/10/2015</th>
<th>105</th>
<th>FA</th>
</tr>
</body>
</table>
</html>
Main:-
<html>
<head>
<title>css</title>
<style>
body{background-color:red;}
</style>
</head>
<frameset cols="40%,60%">
</frameset>
<body>
</body>
</html>
Class:-
<html>
<head>
<title> city</title>
</head>
<pre>
<h1>City</h1>
<ul>
<a href="tableQ5.html"><h2><li>FYBCA
<a href=""><li>SYBCA
<a href=""><li>TYBCA
</h2></ul>
</html>
o/p:-
Q.6 Write a JavaScript program to read a character string from user and perform the following
functions:
a) Accept a character from user and count the number of occurrences of that character in the
string.
b) Accept a Position from user and print the character at specified position (Use Prompt()).
<HTML>
<Head>
<Script type="text/javascript">
function count()
{
var s=document.frm.text.value;
if(document.getElementById("c1").checked==true)
{
var ch=prompt("Enter the character:");
var count=0;
for(var i=0;i<s.length;i++)
{
if(s[i]==ch)
count++;
}
alert("Occurence is"+count);
}
if(document.getElementById("c2").checked==true)
{
var p=prompt("Enter the position:");
var i=0;
while(i<=s.length)
{
if(i==p)
{
var d=i;
document.write(p+"position character is"+s.charAt(d));
}
i=i+1;
}
}
}
</Script>
</Head>
<Body>
<Form name="frm" onsubmit="return count()">
Enter string:<input type="text" name="text" id="c">
<Br><Br><input type="radio" name="opt" id="c1"> Accept character & count it occurence
<Br><Br><input type="radio" name="opt" id="c2"> print character at particular position
<Br><Br><input type="submit">
</Form>
</Body>
</HTML>
o/p:-
Q.8 Write a JavaScript program to design student registration form and perform following validation
on null value, alphabets, mobile no, pin code for Student Registration form.
<html>
<body>
<pre>
<br>name of student: <input type="text" name="nos">
<br><input type="submit">
</pre>
</form>
<script>
function val()
var name=document.m.nos.value;
var mno=document.m.mn.value;
var ad=document.m.addr.value;
var cty=document.m.ct.value;
var sta=document.m.st.value;
var pn=document.m.pnc.value;
return false;
else if(mno.length!=10)
return false;
}
else if(pn.length!=6)
return false;
</script>
</body>
</html>
o/p:-
Main:-
<HTML>
<Head></Head>
<Frameset rows="20%,80%">
<Frame src="homehead.html">
<Frameset cols="20%,80%">
<Frame src="homeleft.html">
<Frame src="homeright.html">
</Frameset>
</HTML>
Homehead:-
<HTML>
<Head></Head>
<Body>
</Body>
</HTML>
Homeleft:-
<HTML>
<Head></Head>
<Body>
<a href="home.html">Home</a>
<Br><Br><a href="profile.html">Profile</a>
</Body>
</HTML>
Homeright:-
<HTML>
<Head></Head>
<Body>
<Table>
<tr>
</tr>
<tr>
</tr>
<tr>
</BOdy>
</HTML>
Profile:
<HTML>
<Body>
<pre>
<Br><Br>Timeline Friends
</pre>
</BOdy>
</HTML>
o/p:-
Head:-
<html>
<head>
<body>
<pre>
</body>
</html>
<html>
<head>
</head>
<body>
<form action="details.html">
</form>
</body>
</html>
Booking:-
<html>
<head>
</head>
<body>
<form>
<table>
<tr>
<th>Booking Information</th>
</tr>
<tr>
<td>From:</td>
</tr>
<tr>
<td>To:</td>
</tr>
<tr>
<td>Departure Date:</td>
</tr>
<tr>
<td>Returning Date:</td>
</tr>
<tr>
<td>Adults </td>
<td>children </td>
<td>Economy </td>
</tr>
<tr>
<tr>
</tr>
</table>
</form>
</body>
</html>
Details:
<html>
<head>
</head>
<body>
<table border=2>
<tr>
<td> class</td>
<td>fare</td>
</tr>
<tr>
<td> <br></td>
<td><br></td>
</tr>
<tr>
<td>economy</td>
<td>10,000</td>
</tr>
<tr>
<td> <br></td>
<td><br></td>
</tr>
</table>
</html>
Main:-
<html>
<head>
</head>
<frameset rows="20%,20%,60%">
</frameset>
</html>
o/p:-
Q.11 write java script to design customer account details.
<HTML>
<Body>
<Br><input type="submit">
</Form>
<Script>
function valid()
var x=document.form4.c.value;
var y=document.form4.b.value;
var z=document.form4.ac.value;
var p=document.form4.pa.value;
return false;
var letter=/^[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}$/;
if(p.match(letter))
return true;
else
return false;
</Script>
</Body>
</HTML>
Q.12 write a java script to compare the values of password and confirmed password.
<HTML>
<Body>
<Br><input type="submit">
</Form>
<Script>
function validate()
if(document.myform.uname.value=="")
return false;
if(document.myform.pas.value=="")
return false;
}
if(document.myform.cpas.value=="")
return false;
if(document.myform.pas.value.length!
=document.myform.cpas.value.length)
return false;
</Script>
</Body>
</HTMl>
Q.13 Write a JavaScript program to accept user name and password from a user, if Username and
Password is same then display his score card on the next page.
<HTML>
<Body>
<Form name="myform1">
<Script type="text/javascript">
function validate()
if(document.myform1.uname.value=="")
return false;
if(document.myform1.pas.value=="")
return false;
if(document.myform1.uname.value=document.myform1.pas.value)
location.replace("q.13.html");
alert("successfully");
</Script>
</Body>
</HTML>
Q.14 Write a JavaScript program to read employee details and generate pay slip which will calculate
netsalary of an employee.
<html>
<body>
<script>
function netsal()
var nm=document.getElementById("ename").value;
var de=document.getElementById("dept").value;
var des=document.getElementById("desg").value;
var basal=document.getElementById("sal").value;
var hr=document.getElementById("hra").value;
var d=document.getElementById("da").value;
document.write(n);
document.write(nm);
</script>
<h1><align="center">Payslip</align></h1>
<br>
<input type="submit">
</form>
</body>
</html>
o/p:-
Q.15.Write a PHP script to accept the details of employee (ename, designation, department, gender,
salary) and display it on next page.
empmain.html
<html>
<head><title>slip15</title></head>
<body>
<Pre>
</form>
</Pre>
</body>
</html>
empop.php
<?php
$ename=$_GET["ename"];
$desg=$_GET["desg"];
$dept=$_GET["dept"];
$gender=$_GET["gender"];
$salary=$_GET["salary"];
?>
Image.html
<html>
<body>
<select name="img">
<option value=tower.jpg>tower.jpg</option>
<option value=dog.jpg>dog.jpg</option>
<option value=eagle.jpg>eagle.jpg</option>
<option value=photo.jpg>photo.jpg</option>
</select>
</form>
</body>
</html>
Q16.php
<?php
$image1=$_GET["img"];
?>
Q.17. Multiplication table
Html file-
<html>
<body>
ENTER A VALUE :
</form>
</body>
</html>
Php file-
<?php
$val=$_REQUEST['fnum'];
for($i=1;$i<=10;$i++)
?>
Html file-
<html>
<body>
<form action="bp.php">
<input type="submit">
</form>
</body>
</html>
Php file-
<?php
$today=date("l");
echo("<h2>$today</h2>");
switch($today)
case "Sunday":$bgcolor="green";
break;
case "Monday":$bgcolor="blue";
break;
case "Tuesday":$bgcolor="Orange";
break;
case "Wednesday":$bgcolor="red";
break;
case "Thursday":$bgcolor="yellow";
break;
case "Friday":$bgcolor="black";
break;
default:$bgcolor="brown";
break;
echo("<body bgcolor=$bgcolor>");
?>
Html file-
<html>
<head><title>Number</title></head>
<body>
</form>
</body>
</html>
Php file-
<?php
$n=$_GET["no"];
$no=strrev($n);
while($no > 1)
$digit= $no%10;
$no= $no/10;
switch($digit)
break;
break;
break;
break;
break;
case "5": echo"Five";
break;
break;
break;
break;
break;
?>
Q.20 php to count no of vowels. Show occurrence of each vowel from string.
Html file-
<html>
<body>
</form>
</body>
</html>
Php file-
<?php
$str=$_GET["str"];
$l=Strlen($str);
for($p=0;$p<$l;$p++)
if($str[$p]=="a" || $str[$p]=="A")
$a++; $tot++;
if($str[$p]=="e" || $str[$p]=="E")
$e++; $tot++;
if($str[$p]=="i" || $str[$p]=="I")
$i++; $tot++;
if($str[$p]=="o" || $str[$p]=="O")
$o++; $tot++;
if($str[$p]=="u" || $str[$p]=="U")
$u++; $tot++;
}
echo"Total number of Vowel a is:".$a."<br>";
?>
Q.21 HTML form to accept 2 numbers. Give options to choose arithmetic operations.
Arithmetic.html
<html>
<body>
<table>
</table>
</form>
</body>
</html>
addition.php
<?php
$no1 = $_GET["no1"];
$no2 = $_GET["no2"];
$cal =$_GET["cal"];
if($cal==1)
$add = $no1+$no2;
else if($cal == 2)
$sub = $no1-$no2;
else if($cal == 3)
$mult = $no1*$no2;
else if($cal == 4)
$div = $no1/$no2;
}
?>
Q.22. Strings
<html>
<head><title>Stringq22</title>
<body>
</form>
</body>
</html>
Php file-
<?php
$op=$_GET["op"];
$s=$_GET["s"];
$s1=$_GET["s1"];
$s2=$_GET["s2"];
$s3=$_GET["s3"];
switch($op)
{
case "firstocc" : $m=strpos($s,$s1);
echo"<br>";
echo"First occurance:";
echo"$m";
break;
echo"<br>";
echo"Last occurance:";
echo"$n";
break;
echo"<br>";
echo"Total no of words:";
echo"$c";
break;
echo"Replaced string:<br>";
echo"$d";
break;
?>
Q.23.HTML page to read value for n. Write PHP script to display first n even numbers with font
size=12,color=red and
first n odd numbers with font face=Times New Roman, size=17 and color=yellow.
oddeven.html
<HTML>
<Body>
<Br><input type="submit">
</Form>
</Body>
</HTML>
oeno.php
<?php
$n=$_GET["num"];
for($i=0;$i<$n;$i++)
if($i%2==0)
else
?>
<html>
<head><title>slip25</title>
</title>
<body>
</form>
</body>
</html>
<?php
$pattern = "/^[a-z0-9._]+@[a-z]+\.[a-z]{2,3}$/";
$email=$_GET["email"];
if(preg_match($pattern,$email))
else
?>
Q.30 write a javascript program to display current day,date,month ,year and time on the web page
and geet the user accordingly.
<html>
<body>
<script type="text/javascript">
var currentDate = new Date()
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var n = weekday[d.getDay()];
if (person != null)
document.getElementById("demo").innerHTML =
</script>
</body>
</html>