OU Site

Monday, 2 January 2017

LAB Programs

LAB PROGRAMS

<html>
<body>
<script type="text/javascript">
var a = 33;
var b = 10;
var c = "Test";
var linebreak = "<br />";
document.write("a + b = ");
result = a + b;
document.write(result);
document.write(linebreak);
document.write("a - b = ");
result = a - b;
document.write(result);
document.write(linebreak);
document.write("a / b = ");
result = a / b;
document.write(result);
document.write(linebreak);
document.write("a % b = ");
result = a % b;
document.write(result);
document.write(linebreak);
document.write("a + b + c = ");
result = a + b + c;
document.write(result);
document.write(linebreak);
a = a++;
document.write("a++ = ");
result = a++;
document.write(result);
document.write(linebreak);
b = b--;
document.write("b-- = ");
result = b--;
document.write(result);
document.write(linebreak); </script>  </body>  </html>




1. CREATE A WEB PAGE TO DISPLAY TIME TABLE

<html>

<head>
<title>Demo on Student Details</title>
</head>
<body>
<table Align=center bgcolor=orange border=1>
<tr>
<th></th>
<th>1<sup>st</sup>hour</th>
<th>2<sup>nd</sup>hour</th>
<th>3<sup>rd</sup>hour</th>
<th rowspan=7>B<br>R<br>E<br>A<br>K<br></th>
<th>4<sup>th</sup>hour</th>
<th>5<sup>th</sup>hour</th>
<th>6<sup>th</sup>hour</th>
</tr>
<tr>
<th>Mon</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Tue</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Wed</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Thur</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Fri</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Sat</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<caption>
<h4><font color=red size=6>CLASS ROOM TIMETABLE</font></h4></caption>
</table>
</body>
</html>

2. Create a Web page to display table using all the attributes of table Tag.

<html>
<head>
<title>Demo on Student Details</title>
</head>
<body bgcolor=blue>
<table Align=center bgcolor=cyan border=2>
<tr>
<th colspan=2 rowspan=3><img src="C:\Users\srnk\Desktop\html-lab(programs)\pics\bbb 043.jpg" height=50 width=50></th>
<th colspan=4>POPULATION</th>
</tr>
<tr>
<th colspan=2>state1</th>
<th colspan=2>state2</th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
<tr>
<th rowspan=2>2005</th>
<th>Lit</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Illit</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th rowspan=2>2006</th>
<th>Lit</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
<th>Illit</th>
<td><br></td>
<td><br></td>
<td><br></td>
<td><br></td>
</tr>
<tr>
</table>
</body>
</html> 

3. CREATE A WEBPAGE TO DISPLAY THREE TEXT BOXES AND APPLY FOUR STYLES

<html>

<head>
<title>text box with style</title>
<style type='text/css'>
t1{font-family:arial;font-size:30;color:blue;text-decoration:none;}
t2{font-family:verdana;font-size:30;color:red;text-decoration:underline;}
t3{font-family:times-new-roman;font-size:30;color:pink;text-
decoration:linethrough;font-weight=bold;}
</style>
<body bgcolor=cyan>
<form>
<input type='text' name='tb1' value='srnkgdcbanswada' size=30 maxlength=30 class='t1'>
<input type='text' name='tb2' value='srnkgdc' size=30 maxlength=30 class='t2'>
<input type='text' name='tb3' value='srnkgdc' size=30 maxlength=30 class='t3'>
<br>
</form>
</body>
</center>
</html>

4. CREATE A WEBPAGE FOR OVER LAPPING IMAGES


<html>

<head>
<title>overlapping</title>
</head>
<div style="position:relative;width:424px;height:300px;float:left;">
<span style="position:absolute;top:0px;left:0px;padding:6px;border-style:solid;border-width:10px;background-color:red;">
<img src="C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg" height=130 width=130>
</span>
<span style="position:absolute;top:0px;left:0px;padding:6px;border-style:solid;border-width:10px;background-color:red;">
<img src="C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg" height=130 width=130>
</span>
<span style="position:absolute;top:0px;left:0px;padding:6px;border-style:solid;border-width:10px;background-color:red;">
<img src="C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg" height=30 width=30>
</span>
</div>
</html>

5. create a web page for overlapping text

<html>
<head>
<title>overlapping text</title>
</head>
<p style="line-height:15px;text-align:center;"><span style="font-family:Georgia;font-size:36pxcolor:pink;font-style:normal;font-weight:normal;">
B.Com III Year </span>
</span>
</p>
</html>

6. VB Script for switch case

<html>
<head>
<title>switch case</title>
</head>
<body>
<script type="text/vbscript">
dim choice:choice=2
dim a:a=5
dim b:b=4
dim c
select case choice
case 1
c=a+b
document.write("addition is "&c)
case 2
c=a*b
document.write("multiplication is"&c)
case 3
c=a-b
document.write("subtraction is"&c)
case 4
c=a/b
document.write("division is "&c)
end select
</script>
</body>
</html>

7. HTML Program for List

<html>
<head>
<title>HTML Unordered List</title>
</head>
<body bgcolor="pink">
<ul type="circle">
<li>SRNK GDC</li>
<li>B.Com-III year</li>
<li>WEB-PROGRAM</li>
</ul>
</body>
</html>

<html>
<head>
<title>HTML Ordered List</title>
</head>
<body bgcolor="blue">
<ol type="1">
<li>WEB-PROGRAM</li>
<li>B.Com-III year</li>
<li>SRNK GDC</li>
</ol>
</body>
</html>

8. Write An HTML Code for Vertical Frames

first.html
<html>
<head></head>
<title>frames</title>
<body bgcolor=red>
<ol>
<li>Sandhya</li>
<li>computer</li>
<li>lecturer</li>
<li>banswada</li>
</ol>
</body>

</html>

second.html

<html>
<head></head>
<title>frames</title>
<body bgcolor=red>
<ol>
<li>Sandhya</li>
<li>computer</li>
<li>lecturer</li>
<li>banswada</li>
</ol>
</body>

</html>

<html>
<head>
</head>
<title>frames</title>
<frameset cols="25%,25%">
<frame name="first" src="first.html">
<frame name="second" src="second.html">
</frameset>
</html>

9. HTML FOR TEXT DECORATION ATTRIBUTES


<html>

<head>
<title>text styles</title>
<style>
h1{text-decoration:overline;color:red;}
h2{text-decoration:line-thorugh;color:blue;}
h3{text-decoration:underline;color:pink;}
</style>
</head>
<body bgcolor=yellow>
<img src="C:\Users\Public\Pictures\Sample Pictures\Desert.jpg">
<h1>WELCOME TO SRNK GDC BNS</h1>
<h2>Bcom-III year</h2>
<h3>WEB-PROGRAMMING</h3>
</body>
</html>

10. 

11. VB Script program to display name of student using arrays

<html>
<head>
</head>
<body bgcolor="pink">
<h2>
<p align="center">For each statement to show every elements in an array</p>
</h2>
<center>
<h3>
<script type="text/vbscript">
dim name(4)
name(0)="sandhya"
name(1)="shashi"
name(2)="shrutha"
name(3)="preethi"
name(4)="keerthi"
for each eatables in name
document.write(eatables)
document.write("</br>")
next
</script>
</body>
</html>

12. VB Script Program for fibonacci number

<html>
<body>
<center>
<script type="text/vbscript">
dim a,b,c
a=0
b=1
while c<21
document.write(b&"<br/>")
c=a+b
a=b
b=c
wend
</script>
</center>
</body>
</html>

13. VB Program for multiplication table for a given number

<html>
<head>
<title>multiplication</title>
</head>
<script type="text/vbscript">
dim x,i,y,product,j,table
x=inputbox("enter the number")
for i=1 to 10
product=i*j
x=i&"*"&j&"="&product
table=table&vbnewline&x
next
next
msgbox table
</script>
</head>
</html>

14. VB Script program for factorial of a given number 

<html>
<head>
<title>fact</title>
<script type="text/vbscript">
dim number,counter,fvalue
number=6
fvalue=1
for counter=number to 1 step-1
fvalue=fvalue*counter
next
msgbox fvalue
</script>
</head>
</html>

15. VB Script program for prime number

<html>
<head>
<title>prime</title>
<script type="text/vbscript">
dim i,j,n
n=inputbox("enter a number")
for i=2 to n
count=0
for j=1 to i
if i mod j=0 then
count=count+1
end if
next
if count=2 then
num=i
prime=prime&space(2)&num
end if
next
msgbox prime
</script>
</head>
</html>

16. Generate date and Time vbscript program


<html>
<body>
<center>
<script type="text/vbscript">
d=cdate("october 22,2010")
document.write(d&"<br/>")
document.write("current system date is:"date&"<br/>")
document.write("current system date is:"time&"<br/>")
document.write(datepart("m",now())&"<br/>")
document.write(dateadd("yyyy",1,"31-jan-10")&"<br/>")
document.write(monthname(10,true)&"<br/>")
fromdate="22-sep-10 00:00"
todate="21-oct-10  23:59:00"
document.write(datediff("m",fromdate,todate)&"<br/>")
document.write(datediff("y",fromdate,todate)&"<br/>")
document.write(datediff("w",fromdate,todate)&"<br/>")
document.write(datediff("h",fromdate,todate)&"<br/>")
</script>
</center>
</body>
</html>


18.VB Script for square and cube of a number.

<html>

<head><title>vbscript test</title>
</head>
<body>
<script type="text/vbscript">
function multfunction(x)
multfunction=x*x
end function
document.write(multfunction(5)&"<br>")
function cube(x)
cube=x*x*x
end function
document.write(cube(5))
</script>
</body>

</html>


No comments:

Post a Comment