Professional Documents
Culture Documents
Roll No.: - 64
2021 -2022
RAMNIRANJAN JHUNJHUNWALA
COLLEGE
Ghatkopar (W), Mumbai-400 086
Certificate
Bhide
INDEX
Practical Practical Details Dates Remarks
No.
3. JavaScript 16/02/22
9. Email 26/03/22
Source code:-
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title</title>
<style>
</style>
</head>
<body>
<p> <b> SHIVAM PRAJAPATI </b> </p>
<p><strong>I love coding.</strong></p>
<p><i>HTML5 is computer language.</i></p>
<p><em>Good morning.</em></p>
<p><mark>My roll no. is 64.</mark></p>
<p><u>I am learning Web Programming.</u></p>
<p><strike>HTML5 is not supported teletype.</strike></p>
<p><sup>Ramniranjan Jhunjhunwala College.</sup></p>
<p><sub>Today is very 🥶 environment.</sub></p>
<p><del>Display detected content.</del></p>
<p><ins>Display added content.</ins></p>
<p><big>Shivam is very Intelligent 🤓.</big></p>
<p><small>HTML5 having 14 FORMATTING tags</small></p>
</body>
</html>
Source code:-
One.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>One</title>
<style>
</style>
</head>
<body>
<a href="two.html">Go to Two.html</a>
</body>
</html>
Two.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Two</title>
<style>
</style>
</head>
<body>
<a href="three.html">Go to three.html</a>
<p><b>Shivam Parmesh Prajapati.</b></p>
Three.html
<!DOCTYPE html>
<hrtml>
<head>
<title>Three</title>
</head>
<body>
Welcome to Hyperlinks.
</body> </html>
Output:-
B)
Source code:-
<!DOCTYPE html>
<html>
<head>
<title>linking within the same file</title>
</head> <body>
Ca name=”top”>top region</a>
<br>
<br>
</body> </html>
Output:-
Generate a nested list as follows: (Display Fruits and Vegetables in "red" font color using
inline style, Display Mango, Banana and Apple in font color "Blue" and Tomato, Potato
and Carrot in font color "Yellow" using internal stylesheet, set background color for
Fruits and Vegetables to pink using external stylesheet). Hint: use id/class attributes
and/or styles for nested tags.
A) Fruits .
1) Mango
2) Banana
3) Apple
B) Vegetables
IV. Tomato
V. Potato
VI.Carrot
#) CREATE YOUR OWN WEB PAGE USE THE ABOVE EXAMPLE AS REFERENCE.
<!DOCTYPE html>
<html>
<head>
<title>nested lists</title>
<style type=”text/css”>
Subject & Teachers Name Of 1st Semester (color:blue)
Subject & Teachers Name Of 2nd Semester (color:yellow)
</style>
<link rel=”stylesheet” type=”text/css” href=”one.css”> </head>
<body>
<ul style=”list-style-type:filled square”>
<li class=”bg” style=”color:red”> Subject & Teachers Name Of 1st Semester</li>
<ol style=”list-style-type:upper-roman”>
<li class=”Subject & Teachers Name Of 1st Semester”>Operating system – Punam Sindhu
ma’am
</li>
<li class=” Subject & Teachers Name Of 1st Semester”>Digital Electronic – Archana
ma’am</li>
<li class=” Subject & Teachers Name Of 1st Semester” > Impreative Programing – Priyasha
Ma’am</li>
<li class=” Subject & Teachers Name Of 1st Semester” > Communication Skills – Jeba
Ma’am</li>
<li class=” Subject & Teachers Name Of 1st Semester” > Discrete Mathematics- Poonam
Ma’am</li>
</ol> </ul>
<ol style=”list-style-type:lower-alpha”> <li class=”bg” style=”color:red”> Subject &
Teachers Name Of 2nd Semester</li>
<ol class=”grp1” start=”6” style=”list-style-type:uppper-roman”>
<li class=”Subject & Teachers Name Of 2nd Semester”> Web Programming - Anju Rai </li>
<li class=”Subject & Teachers Name Of 2nd Semester”> Green computing – Priyasha
Ma’am</li>
<li class=”Subject & Teachers Name Of 2nd Semester”> Microprocessor Architecture –
Archana ma’am</li>
Output:-
Output:-
Source code:
<!DOCTYPE html>
<html>
<head>
<head>
<style>
aside {
width: 30%;
padding-left: 15px;
margin-left: 15px;
float: right;
font-style: italic;
background-color: lightgray;
</style>
</head>
<body>
<nav>
<a href="https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_nav">NAV</a> l
<section>
</p>
<article>
<header>
</header>
An article should make sense on its own, and it should be possible to distribute it
independently from the rest of the web site.
</p>
</article>
<aside>
</aside>
<footer>
Ramniranjan Jhunjhunwala College
Name: Shivam Prajapati Web Programing
Roll No.: - 64
<p>HTML CODE WRITER: SHIVAM PRAJAPATI</p>
prajapatishivam7634@gmail.com</a></p></footer>
<figure>
</figure>
</body>
</html>
Source code:
<!DOCTYPE html>
<html>
<style>
table, th, td {
</style>
<body>
<table style="width:100%">
<tr>
<th>Name</th>
<th>Roll no.</th>
<th>Subject</th>
<th>Marks</th>
</tr>
<tr>
<td>Shivam Prajapati</td>
<td>64</td>
<td>Microprocessor Architecture</td>
<td>100</td>
<td>O++</td>
</tr>
<tr>
<td>Zainab Khan</td>
<td>41</td>
<td>Python Programing</td>
<td>98</td>
<td>O+</td>
</tr>
<tr>
<td>Himanshu Chaurasiya</td>
<td>15</td>
<td>Web Programing</td>
<td>95</td>
<td>A++</td>
<tr>
<td>Satya Pandey</td>
<td>58</td>
<td>90</td>
<td>A+</td>
</tr>
<tr>
<td>Shivam Pal</td>
<td>54</td>
<td>Green Computing</td>
<td>88</td>
<td>A</td>
</tr>
</table>
<footer>
prajapatishivam7634@gmail.com</a></p></footer>
</body>
Output:
Source code:
<!DOCTYPE html>
<html>
<body>
<form action="/action_page.php">
</form>
<form>
<label for="fyit">FYIT</label><br>
<label for="syit">SYIT</label><br>
<label for="tyiy">TYIT</label>
</form>
<form action="/action_page.php">
</form>
</body>
</html>
Source code:
<!DOCTYPE html>
<html>
<head>
<title>Multimedia</title>
</head>
<body>
<header>Multimedia Implementation By Shivam Prajapati</header>
Video File: <video width="240" height="320" controls>
<source
src="/storage/emulated/0/DCIM/Camera/video_20220213_101336.mp4"
type="video/ogg">
</video>
<br>
Audio File: <audio width="240" height="320" controls>
<source
src="/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/
WhatsApp Audio/AUD-20211214-WA0022.mp3">
</audio>
<footer>
<p>HTML CODE WRITER: SHIVAM PRAJAPATI</p>
<p><a href="mailto:prajapatishivam7634@gmail.com" >
prajapatishivam7634@gmail.com</a></p></footer>
</body>
</html>
Output:
A. Using JavaScript design, a web page that prints factorial/Fibonacci series/any given
series.
a.Factorial.
Source code:-
<!DOCTYPE html>
<html>
<head>
<title>Factorial Demo</title>
<script language=”javascript”>
Var x=parseInt(prompt(“Enter a number”,””));
Var fact=1,I;
For(i=1;i<=x;i++)
Fact*=I;
Document.write(“<h1>Factorial of “+x+” is : “+fact+”</h1>”);
</script>
</head>
<body>
</body>
</html>
Output:
b.Fibonacci:-
Ramniranjan Jhunjhunwala College
Name: Shivam Prajapati Web Programing
Roll No.: - 64
Source code:
<!DOCTYPE html>
<html>
<head>
<title>Fibonacci series Demo</title>
<script language=”javascript”>
Var a=0,b=1,c,n,I;
N=parseInt(prompt(“Enter limit for fibonacci series:”,””));
Document.write(“<h2> Fibonacci series: </h2><br>”);
Document.write(a+” “+b+” “);
For(i=2;i<n;i++)
{
C=a+b;
Document.write(c+” “);
A=b;
B=c;
}
</script>
</head>
<body>
</body>
</html>
Output:
C) Design a web page with different tables. Design a webpage using table so that
the content appears well placed.
Source code:
<!DOCTYPE html>
<html>
<head>
<title>Form Validation</title>
<script type="text/javascript">
function validate()
{
if( document.myForm.Name.value == "" )
{
alert( "Please provide your name!" );
document.myForm.Name.focus();
return false;
}
if( document.myForm.EMail.value == "" )
{
alert( "Please provide your Email!" );
document.myForm.EMail.focus();
return false;
}
if( document.myForm.MobileNo.value == "" ||isNaN(
document.myForm.MobileNo.value ) ||
document.myForm.MobileNo.value.length != 10)
{
alert( "Please provide your MobileNo in the format ##########!" );
Ramniranjan Jhunjhunwala College
Name: Shivam Prajapati Web Programing
Roll No.: - 64
document.myForm.MobileNo.focus();
return false;
}
{
alert( "Please provide a zip in the format ##########." );
document.myForm.MobileNo.focus();
return false;
}
Output:
Source code:
<!DOCTYPE html>
<html>
<head>
<h4>Prime no. between 1 to 100.</h4>
<title>prime number</title>
<script>
for(var i=1;i<=100;i++)
{
var flag=0;
for(var j=2;j<=i/2;j++)
{
if(i%j==0)
{
flag=1;
break;
}
}
if(flag==0)
{
document.write(i+"<br>");
}
}
</script>
</head>
</html>
Source code:
<!DOCTYPE html>
<html>
<head>
<h3>Sum of digits of any given numbers </h3>
<title>sum of digits</title>
<script>
Var n=parseInt(prompt(“Enter the number”,” “));
Var p=0,y;
While(n>0)
{
Y=n%10;
N=parseInt(n/10);
P=p+y;
}
Document.write(“Sum of digits is: “+p);
</script>
</head>
</html>
Output:
E.Write a program in JavaScript to accept a sentence from the user and display the
number of Words in it. (Do not use split () function).
Source code:
<!DOCTYPE html>
<html>
<head>
<h3>Finding how many words are given in the sentence.</h3>
<title>Without using split function</title>
<script>
var str=prompt("Enter the sentence=","");
var count=0;
for(i=0;i<str.length;i++)
{
if(str.charAt(i,1)==" " && str.charAt(i+1,1)!=" ")
count++;
}
document.write("Number of words are="+(count+1));
</script>
</head>
<body>
</body>
</html>
Output:
Source code:
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<script language=”javascript”>
Function calc()
{
Var n1,n2,opr,x;
N1=parseInt(f1.s1.value);
N2=parseInt(f1.s3.value);
Opr=f1.s2.value;
If(opr==”add”)
X=n1+n2;
Else if(opr==”sub”)
X=n1-n2;
Else if(opr==”multi”)
X=n1*n2;
Else if(opr==”div”)
X=n1/n2;
Else
Alert(“please select operator”);
Document.getElementById(“ans”).innerHTML=”answer is:”+x;
}
</script>
</head>
<body>
<form name=”f1”>
<table width=50%>
<tr>
<td>Number1<br>
<select name=”s1” size=2>
<option>Select</option>
<option value=”0”>0</option>
Output:
Source Code:
<!-- Name: Shivam Prajapati
Roll No:64
Use of Conditional Statement -->
<!DOCTYPE html>
<html>
<head>
<title>Conditional Statements</title>
<script language="javascript">
var Roll_No = prompt("Enter Your Roll No.");
if (Roll_No > 64) {
</script>
</head>
<body>
</body>
</html>
Output:
<p id="demo"></p>
<script>
const student = ["Shivam", "Himanshu", "sanjeet", "Sandeep", "Gaurav", "Romit"];
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
<p id="demo"></p>
<script>
const cars = ["Bugati", "Mercedes", "Suzuki", "TATA", "Roals Royals"];
document.getElementById("demo").innerHTML = cars;
document.write("Array length is: "+cars.length+"<br>");
</script>
</body>
</html>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = Boolean(10 > 9);
</script>
</body>
</html>
Output:
<h2>JavaScript Functions</h2>
<p>This example calls a function which performs a calculation, and returns the result:</p>
<p id="demo"></p>
<script>
function myFunction(p1, p2) {
return p1 * p2;
}
document.getElementById("demo").innerHTML = myFunction(41, 64);
</script>
</body>
</html>
Output:
<h2>JavaScript Math</h2>
<script>
document.getElementById("piDemo").innerHTML = Math.PI;
document.getElementById("sqrtDemo").innerHTML = Math.sqrt(64);
</script>
</body>
</html>
<h2>JavaScript Numbers</h2>
<p id="demo"></p>
<script>
let x = 64;
let y = 64.41;
document.getElementById("demo").innerHTML = x + "<br>" + y;
</script>
</body>
</html>
Output:
<h2>JavaScript Strings</h2>
<p id="demo"></p>
<script>
let text = "Shivam Prajapati"; // String written inside quotes
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
H. Regular Expression.
Source Code:
<!DOCTYPE html>
<html>
<body>
<p>Search a string for "Shivam", and display the position of the match:</p>
<p id="demo"></p>
<script>
let text = "Visit Shivam!";
let n = text.search("Shivam");
document.getElementById("demo").innerHTML = n;
</script>
</body>
</html>
I. JavaScript Object:
Source code:
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Variables</h2>
<p id="demo"></p>
<script>
// Create and display a variable:
let Student_Roll_No = "64";
document.getElementById("demo").innerHTML = Student_Roll_No ;
</script>
</body>
</html>
Output:
A) Write a PHP Program to accept a number from the user and print it factorial.
Source Code:
<!-- Shivam Prajapati
Roll No.- 64 -->
<html>
<head>
<title>Factorial of a number</title>
</head>
<body>
<form method="post" action= "fact.php">
Enter a number: <input type="text" name="n1"><br>
<input type="submit" value="Factorial">
</form>
<?php
$n1=(int)$_POST['n1'];
$fact=1;
for($i=1;$i<=$n1;$i++)
{
$fact=$fact*$i;
}
echo "Factorial of ".$n1." is: ".$fact;
?>
</body>
</html>
Output:
<!DOCTYPE html>
<html>
<head>
<title>Prime Number</title>
</head>
<body>
<form method="post" action="checkPrime.php">
Enter a number: <input type="text" name="n1"><br>
<input type="submit" value="CheckPrime">
</form>
<?php
$n1=(int)$_POST['n1'];
$flag=0;
for($i=2;$i<=$n1/2;$i++)
{
if($n1%$i==0)
{
$flag=1;
break;
}
}
if($flag==0)
echo $n1. "is prime Number";
else
echo $n1. "is not prime Number";
?>
</body>
</html>
Output:
A.Write a PHP code to find the greater of 2 numbers. Accept the no. from the user.
Source code:
<!-- Shivam Prajapati
Roll No.- 64 -->
<!DOCTYPE html>
<html>
<head>
<title>Greater of two no.s</title>
</head>
<body>
<form method="post">
1st Number: <input type="text" name="n1"><br>
2nd Number: <input type="text" name="n2"><br>
<input type="submit" value="Check">
</form>
<?php
$n1=(int)$_POST['n1'];
$n2=(int)$_POST['n2'];
if($n1>$n2)
echo $n1." is greater than ".$n2;
else if($n2>$n1)
echo $n2." is greater than ".$n1;
else
Output:
Source code:
Output:
Output:
Output:
<DOCTYPE html>
<head>
<title>Creating database</title>
</head>
<html>
<body>
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
else
mysql_select_db("College",$con);
if(mysql_query($query,$con))
else
mysql_close($con);
?>
</body>
</html>
<DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
else
mysql_select_db("College",$con);
if(mysql_query($query,$con))
else
if(mysql_query($query1,$con))
else
if(mysql_query($query2,$con))
else
if(mysql_query($query3,$con))
else
$result=mysql_query($sql,$con);
if(mysql_num_rows($result)>0)
echo "<table
border='1'><tr><th>Sno</th><th>Sname</th><th>Percentage</th></tr>";
while($row=mysql_fetch_assoc($result))
echo "<tr>";
echo "<td>".$row['sno']."</td>";
echo "<td>".$row['sname']."</td>";
echo "<td>".$row['percentage']."</td>";
echo "</tr>";
echo "</table>";
else
mysql_close($con);
Ramniranjan Jhunjhunwala College
Name: Shivam Prajapati Web Programing
Roll No.: - 64
?>
</body>
</html>
Output:
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>
<?php
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
</body>
</html>
<?php
if(!isset($_COOKIE[$cookie_name])) {
echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
echo "Cookie '" . $cookie_name . "' is set!<br>";
echo "Value is: " . $_COOKIE[$cookie_name];
}
?>
<p><strong>Note:</strong> You might have to reload the page to see the value of the
cookie.</p>
</body>
Ramniranjan Jhunjhunwala College
Name: Shivam Prajapati Web Programing
Roll No.: - 64
</html>
Output: