0% found this document useful (0 votes)
76 views27 pages

Anurag Devnath Bca 1web TCH

The document is a practical assignment on web technology and e-commerce submitted by Prakritee John. It contains an acknowledgement section thanking various individuals and institutions for their support. The document also contains an index listing various HTML, JavaScript, DHTML and PHP programs that are part of the practical assignment. It provides the outline and structure for programs on key front-end technologies.

Uploaded by

Poras Chahande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views27 pages

Anurag Devnath Bca 1web TCH

The document is a practical assignment on web technology and e-commerce submitted by Prakritee John. It contains an acknowledgement section thanking various individuals and institutions for their support. The document also contains an index listing various HTML, JavaScript, DHTML and PHP programs that are part of the practical assignment. It provides the outline and structure for programs on key front-end technologies.

Uploaded by

Poras Chahande
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

A

PRACTICAL ASSIGNMENT
ON

Web Technology and E-Commerce

HEMCHAND YADAV VISHWAVIDYALAYA DURG (C.G)

BACHELOR OF COMPUTER APPLICATION – 1ST YEAR FOR

SESSION: 2021-2022

GUIDED BY: SUBMITTED BY:

Chetana Sahu Prakritee John

SUBMITTED TO
GD RUNGTA COLLEGE OF SCIENCE AND TECHNOLOGY, BHILAI (C.G)
CERTIFICATE BY THE EXAMINER

This is to certify that the project work entitled “WEB TECHNOLOGY AND
E-COMMERCE” submitted by Prakritee John of BCA 1st YEAR has been
examined by the undersigned as a part of the examination and is here by
recommended for the degree of Bachelor of Computer Application of
Hemchand Yadav vishwavidyalaya, Durg.

Internal Examiner

Date:
ACKNOWLEDGEMENT

The real spirit of achieving a goal is through the way of excellence and
austerious discipline. I want to thank GDRCST, Bhilai for providing me the
necessary software, tools and other resources to deliver my Practical assignment.

I acknowledge with gratitude and humanity my


indebtedness to Ms. Chetana Sahu , under whose guidance I had the privilege
to complete this assignment.

I shall be failing in my duties if I do not express my duty sense of


gratitude towards HOD Dr Jyoti Upadhyay, Assistant Professor & Head of
Department of Computer Science GDRCST, Bhilai.

I owe my sincere thanks to Dr. Neema S. Balan, Principal, GDRCST,


Bhilai for inspiration and constant encouragement that enabled me to present my
work in this form.

My greatest thanks go to my parents and my family who has been my


driving force.Above all I render my gratitude to the almighty, who bestowed
self-confidence, ability and strength in me to complete this work.

Prakritee John
INDEX

S.NO. PRACTICALS Pg.no. SIGNATURE

HTML
1 Write an HTML Program to create the following table:

2 Write an HTML Program to create the following Lists:


C
 C++
 FORTRAN
 COBOL

3 Write an HTML Program to create the following Lists:

1. Java
2. Visual Basic
3. BASIC
4. COBOL

4 Write an HTML Program to create the following table:

5 Write an HTML Program to create the following document using


FrameSet and Frame tags:

6 Write an HTML Program to create the following document using FrameSet


and Frame tags:

7 Write an HTML Program to create the image as backgroung with


following paragraph

8 Write an HTML Program to create the following form

9 Write an HTML Program to create the following form

10 Write an HTML Program to create the Web Page with alt text and
width and height of 300 pixel
S.NO. PRACTICALS Pg.no.

JAVASCRIPT
1 Write an JAVASCRIPT Program to create a script using for loop to prime no
between 1 to 50

2 Write an JAVASCRIPT Program to calculate factorial using function

3 Write an JAVASCRIPT Program to validate data

4 Write an JAVASCRIPT Program to print Date

5 Write an JAVASCRIPT Program to calculate sum and multiplication of two


numbers

6 Write an JAVASCRIPT Program to show alert, confirm and prompt box

7 Write an JAVASCRIPT Program to validate form

DHTML
1 Create a Web Page which explain the use of relative positioning

2 Design a Web Page to display a digital clock

PHP
1 Create a script using for loop to add all integers between 0 and 30 and display
the total
2 Create a script using for loop to find largest value in array.

3 Write a function to calculate the factorial of a number

4 Check a string is Palindrome or not


JAVASCRIPT
Program no 1 :- Write an JAVASCRIPT Program to create a script using for loop to prime no
between 1 to 50

<!---Write an JAVASCRIPT Program to create a script using for loop to prime no between 1 to 50 -
--->

<html>
<head>
<title>Prime Number</title>
</head>
<body>
<script>
var num,i;
document.write("Prime Number betweeen 1 to 50 using loop: <br>");
for(i=1;i<=50;i++)
{
var flag=true;
for(num=2;num<i;num++){
if(i%num==0){
flag=false;
break;
}
}
if(flag){
document.write(i+", ");
}
}
</script>
</body>
</html>

Output:-
Program no 2:- Write an JAVASCRIPT Program to calculate factorial using function

<!---Write an JAVASCRIPT Program to calculate factorial using function---->

<html>
<head>
<title>Program no 23</title>
</head>
<body>
Enter No:<input id="num" name="num"/><br/>
<button onclick="factorial()">Factorial</button><p id = "res"></p>

<script type="text/javascript">

function factorial(){
var num,i,f;
num=document.getElementById("num").value;

f=1;
for(i=1;i<=num;i++){
f=f*i;
}
i=i-1;
document.getElementById("res").innerHTML="The factorial of the number "+i+ "is:" +f;
}
</script>
</body>
</html>

Output:-
Program no 3:- Write an JAVASCRIPT Program to validate data

<!---Write an JAVASCRIPT Program to validate data ---->

<html>
<head>
<title>Program no 24</title>
</head>
<body>

<script>
function validate(){
var num=document.myform.num.value;
if (isNaN(num)){
document.getElementById("numloc").innerHTML="Enter only Numeric value ";
return false;
}else{
return true;
}
}
</script>
<form name="myform" onsubmit="return validate()" >
Enter a Number: <input type="text" name="num"><span id="numloc"></span><br/>
<input type="submit" value="submit">
</form>
</body>
</html>

Output:-
Program no 4:- Write an JAVASCRIPT Program to print Date

<!---Write an JAVASCRIPT Program to print Date---->

<html>
<head>
<title>Program no 25</title>
</head>
<body>
Current Date and Time: <span id="txt"></span>
<script>
var today=new Date();
document.getElementById('txt').innerHTML=today;
</script>
</body>
</html>

Output:-
Program no 5:- Write an JAVASCRIPT Program to calculate sum and multiplication of two
numbers

<!---Write an JAVASCRIPT Program to calculate sum and multiplication of two numbers-->

<html>
<head>
<title>Program no 26</title>
</head>
<body bgcolor="Grey">

<form name="C">
<p> Enter First Number:&nbsp&nbsp&nbsp&nbsp<input type="text" name="n1" ><br>
<p> Enter Second Number:<input type="text" name="n2">
<br><br>
<input type="button" value=" Addition " onclick="add()">
<input type="button" value=" Multiply " onclick="mul()">
<input type="button" value="Reset">
</form>

<script language="JavaScript">
function add(){
var num1=parseFloat(C.n1.value);
var num2=parseFloat(C.n2.value);
var sum=num1+num2;
alert("Addition is ="+sum);
}

function mul(){
var num1=parseFloat(C.n1.value);
var num2=parseFloat(C.n2.value);
var mul=num1*num2;
alert("Multiplication is ="+mul);
}
</script>

</body>
</html>
Output
Program no 6:- Write an JAVASCRIPT Program to show alert, confirm and prompt box

<!---Write an JAVASCRIPT Program to show alert, confirm and prompt box-->

<html>
<head><title>Program no 27</title></head>
<body bgcolor="grey">
<h3> Displaying Alert, Confirm and Prompt Box together</h3>
<script type="text/javascript">
function alert_msg(){
alert("Hello Alert Box");
}

function confirm_msg(){
var v= confirm("Confirm...");
if(v==true){
alert("ok");
}
else{
alert("cancel");
}
}

function prompt_msg(){
var v= prompt("Prompt Box");
alert("I am "+v);

}
</script>
<input type="button" value="Alert" onclick="alert_msg()"/>
<input type="button" value="Confirm" onclick="confirm_msg()"/>
<input type="button" value="Prompt" onclick="prompt_msg()"/>
</body>
</html>

Output:-
rogram no 7:- Write an JAVASCRIPT Program to validate form

<!---Write an JAVASCRIPT Program to validate form-->

<html>
<head><title>Program no 29</title></head>
<script>
function validateform(){
var name=document.myform.name.value;
var password=document.myform.password.value;

if (name==null || name==""){
alert("Name can't be blank");
return false;
}else if(password.length<6){
alert("Password must be at least 6 characters long.");
return false;
}
}
</script>
<body bgcolor="grey">
<h3> Form Validation</h3>
<form name="myform" method="post" action="abc.jsp" onsubmit="return validateform()" >
UserName:<input type="text" name="name"><br/> <br>
Password: <input type="password" name="password"><br/>
<input type="submit" value="Submit">

</form>
</body>
</html>

Output:-
DHTML
Program no 1:- Create a Web Page which explain the use of relative positioning

<!---Create a Web Page which explain the use of relative positioning-->

<html>
<head>
<style>
h4.pos_left {
position: relative;
left: 0px;
}
h1.pos_right {
position: relative;
left: 30px;
}
</style>
</head>
<body>
<h1 class="pos_right">Heading A</h1>
<h4>This is a paragraph</h4>

<h1 class="pos_right">Heading B</h1>


<h4>This is a paragraph</h4>
<h1 class="pos_right">Heading C</h1>
<h4>This is a paragraph</h4>
<h1 class="pos_right">Heading D</h1>
<h4>This is a paragraph</h4>
</body>
</html>

Output:-
Program no 2:- Design a Web Page to display a digital clock

<!---Design a Web Page to display a digital clock-->

<html>
<head><title>Program no 35</title></head>

Current Time: <span id="txt"></span>


<script>
window.onload=function(){getTime();}
function getTime(){
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
setTimeout(function(){getTime()},1000);
}
//setInterval("getTime()",1000);//another way
function checkTime(i){
if (i<10){
i="0" + i;
}
return i;
}
</script>
</html>

Output:-
PHP
Program no 1:- Create a script using for loop to add all integers between 0 and 30 and
display the total

<!---Create a script using for loop to add all integers between 0 and 30 and display the total-->

<html>
<head>
<title>Program no 36</title>
</head>
<body>
<?php
$sum=0;
for($n=0;$n<=30;$n++){
$sum=$sum+$n;
}
echo "Sum of integers between 0 and 30 is =$sum" ;
?>

</body>
</html>

Output:-
Program no 2:- Create a script using for loop to find largest value in array.

<!---Create a script using for loop to add all integers between 0 and 30 and display the total-->

<html>
<head>
<title>Program no 38</title>
</head>
<body>
<?php
echo "Array:<br>";
$arr=array("55","45","15","25","35");
foreach( $arr as $a )
{
echo "$a<br />";
}
sort($arr); //sorting of array
echo "Largest value in Array: $arr[4]";

?>
</body>
</html>

Output:-
Program no 3:- Write a function to calculate the factorial of a number

Prog 39 IP.html

<html>
<body>

<form action="Prog 39.php" method="get">


Enter a Number: <input type="text" name="num"/>
<input type="submit" value="Calculate Factorial"/>
</form>
</body>
</html>

Prog 39.php

<!---Write a function to calculate the factorial of a number-->

<html>
<head>
<title>Program no 39</title>
</head>
<body>
<?php
function factorial(){
$num=$_GET["num"]; //receiving name field value in $str variable
$f=1;
for($i=1;$i<=$num;$i++){
$f=$f*$i;
}
$i=$i-1;
echo "The factorial of the number $i is: $f";
}
factorial(); //calling function
?>
</body>
</html>
Output:-
Program no 4:- Check a string is Palindrome or not

<!--- Check a string is Palindrome or not -->

Prog 40 IP.html
<html>
<body>

<form action="Prog 40.php" method="get">


Enter a String: <input type="text" name="name"/>
<input type="submit" value="Check"/>
</form>
</body>
</html>

Prog 40.php

<html>
<head>
<title>Program no 40</title>
</head>
<body>
<?php
$str=$_GET["name"]; //receiving name field value in $str variable

$str1=strrev($str);
if($str==$str1){
echo "$str is Palindrome";}
else
echo"$str is not a Palindrome";
?>
</body>
</html>

Output:-

You might also like