Neha Web Techno All
Neha Web Techno All
HTML
Q1.Write an HTML program to create the following table :
Class Subject 1 Subject 2 Subject 3
BCA I Visual Basic PC Software Electronics
BCA II C++ DBMS English
BCA III Java Multimedia CSA
SOURCE CODE:
<html>
<head>
<title> Table format </title>
</head>
<body>
<table border="1">
<tr>
<th> Class </th>
<th>Subject 1 </th>
<th> Subject 2 </th>
<th> Subject 3 </th>
</tr>
<tr>
<th> BCA I </th>
<th>Visual Basic </th>
<th> PC Software </th>
<th> Electronics</th>
</tr>
<tr>
<th> BCA II</th>
<th>C++</th>
<th> DBMS </th>
<th> English</th>
</tr>
<tr>
<th>BCA III</th>
<th>Java</th>
<th> Multimedia</th>
<th> CSA</th>
</tr>
</table>
</body>
</html>OUTPUT:
(I) C
(II) C++
(III) Fortran
(IV) COBOL
SOURCE CODE:
<html>
<head><title> list format </title>
</head>
<body>
<ol type="I">
<li>C </li>
<li>C++ </li>
<li><pre> Fortran</pre></li>
<li><pre> COBOL</pre></li>
</ol>
</body>
</html>OUTPUT:
2. Visual Basic
3. BASIC
4. COBOL
SOURCE CODE:
<html>
<head><title> list format </title>
</head>
<body>
<ol type="1">
<li> Java</li>
<li> Visual Basic </li>
<li> BASIC </li>
<li> COBOL </li>
</ol>
</body>
</html>OUTPUT:
Q4. Write an HTML program to demonstrate hyper linking between two web
pages. Create a marquee and also insert an image in the page.
SOURCE CODE:
First webpage:
<html>
<head><title> hyperlink format </title>
</head>
<body>
<h1><marquee>**WELCOME TO MY FIRST WEBPAGE**</marquee></h1>
<imgsrc="ray-hennessy.jpg" height="250" width="300">
<br><br>
<a href="second.html"><strong>CLICK HERE TO JUMP TO SECOND
WEBPAGE</strong></a>
</body>
</html>
OUTPUT:
Second webpage:
<!DOCTYPE html>
<html>
<head><title> hyperlink</title>
</head>
<body>
<h1><marquee>**WELCOME TO MY SECOND WEBPAGE**</marquee></h1>
<img src="aaron-burden.jpg" height="250" width="300">
<br><br>
<a href="first.html"><strong>CLICK HERE TO JUMP TO FIRST
WEBPAGE</strong></a>
</body>
</html>
OUTPUT:
SOURCE CODE:
<!DOCTYPE html>
<html>
<head><title> frame format </title>
</head>
<frameset cols="30%,40%,30%">
<frame name="FRAME1" src="first.html"/>
<frame name="FRAME2" src="second.html"/>
<frame name="FRAME3" src="third.html"/>
</frameset>
</html>
OUTPUT:
Q6. Write an HTML program to create a web page with a blue background and the
following text.
New Delhi
New Delhi, the capital and the third largest city of India is fusion of the ancient and the
modern. The refrain of the Muslim dynasties with its architectural delights, give the
majestic ambience of the bygone era.
SOURCE CODE:
<html>
<head><title>paragraph</title>
<body bgcolor=”blue”>
<i><u><h1 align="center" >New Delhi</h1></u>
<p>New Delhi, the capital and the third largest city of India is fusion of the ancient
and the modern. The refrain of the Muslim dynasties with its architectural
delights, give the majestic ambience of the bygone era. </p></i>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<head><title> admission</title>
<body>
<u>
<h1>Admission
</h1></u>
<table border="1">
<tr>
<th>Course</th>
<th>OC</th>
<th>BC</th>
<th>MBC</th>
<th>C/ST</th>
<th>TOTAL</th>
</tr>
<tr>
<th>Computer science</th>
<td>9</td>
<td>18</td>
<td>5</td>
<td>5</td>
<td>37</td>
</tr>
<tr>
<th>Commerce</th>
<td>14</td>
<td>25</td>
<td>6</td>
<td>5</td>
<td>50 </td>
</tr>
<tr>
<td colspan="5"><b>Grand total </b></td>
<td>87 </td>
</tr>
</body>
</head>
</html>
SOURCE CODE:
<html>
<head><title> paragraph</title>
</head>
<body>
<u>
<h1 align="center" >Car Price List
</h1></u>
<table align="center" border="1" style="border-collapse: collapse;">
<tr>
<th colspan="2">Maruti</th>
<th colspan="2">Tata</th>
<th colspan="2">Ford</th>
</tr>
<tr>
<th>Model</th>
<th>Price</th>
<th>Model</th>
<th>Price</th>
<th>Model </th>
<th>Price</th>
</tr>
<tr>
<td>Maruti 8000</td>
<td>2 Lac</td>
<td>Sumo</td>
<td>2 Lac</td>
<td>Ikon</td>
<td>5 Lac</td>
</tr>
<tr>
<td>Omni</td>
<td>3 Lac</td>
<td>Scorpio</td>
<td>3 Lac</td>
<td>Gen</td>
<td>2 Lac</td>
</tr>
</table>
</body>
</html>
SOURCE CODE:
<html>
<head><title>table</title>
</head>
<body>
<u>
<h1 align="center">Students Record
</h1></u>
<table align="center" border="1" style="border-collapse: collapse;">
<tr>
<th>Name</th>
<th>Subject</th>
<th>Marks</th>
</tr>
<tr>
<td>Arun</td>
<td>Java</td>
<td>70</td>
</tr>
<tr>
<td></td>
<td>C</td>
<td>80</td>
</tr>
<tr>
<td>Ashish</td>
<td>Java</td>
<td>75</td>
</tr>
<tr>
<td></td>
<td>C</td>
<td>69</td>
</tr>
</table>
</body>
</html>
Q10. Create the HTML document and embed a flash movie in it.
SOURCE CODE:
<!DOCTYPE html>
<html>
<head><title> flash movies</title>
</head>
<body>
<h2>Welcome To Flash movies</h2>
<object width="500" height="400">
<param name="movie" value="car.swf">
<embed src="car.swf" width="500" height="400">
</embed>
</object>
</body>
</html>
OUTPUT:
Q11. Write the HTML coding to display the following table. Also insert an image
in the web page
Subject Max Min obtain
Java 100 33 75
Multimedia 100 33 70
Operating 100 33 68
system
C++ 100 33 73
SOURCE CODE:
<!DOCTYPE html>
<html>
<head><title> Table format</title>
</head>
<body background="background.jpg"><u>
<h1 align="center" >Student records</h1></u>
<table align="center" border="1" style="border-collapse: collapse;">
<tr>
<th>Subject</th>
<th>Max</th>
<th>Min</th>
<th>obtain</th>
</tr>
<tr>
<td>Java </td>
<td>100</td>
<td>33</td>
<td>75</td>
</tr>
<tr>
<td>Multimedia</td>
<td>100</td>
<td>33</td>
<td>70</td>
</tr>
<tr>
<td>Operating system</td>
<td>100</td>
<td>33</td>
<td>68</td>
</tr>
<tr>
<td> C++</td>
<td>100</td>
<td>33l</td>
<td>73</td>
</tr>
</table>
</body>
</html>
SOURCE CODE:
<html>
<head><title> Table format</title>
</head>
<body>
<u>
<h1>Student records
</h1></u>
<table border="1" style="border-collapse: collapse;">
<tr>
<th colspan="2">Name</th>
<th colspan="2" >Rahul</th>
</tr>
<tr>
<th colspan="2">Roll No.</th>
<th colspan="2" >101</th>
</tr>
<tr>
<th> Subject</th>
<th>Max </th>
<th> Min</th>
<th>Obtain </th>
</tr>
<tr>
<td> Java</td>
<td>100</td>
<td> 33</td>
<td>75</td>
</tr>
<tr>
<td> Multimedia</td>
<td>100</td>
<td> 33</td>
<td>70</td>
</tr>
</table>
</body>
</head>
</html>
Enter Age:
Enter DOB:
SOURCE CODE:
<html>
<head>
<title>forms</title>
</head>
<body>
<form>
enter name: <input type="text" name="name"> <br> <br>
enter roll no: <input type="text" name="rollno"><br><br>
enter age: <input type="text" name="age"><br><br>
enter DOB: <input type="text" name="dob">
</form>
</body>
</html>
OUTPUT:
New Delhi, the capital and the third largest city of India is fusion of the ancient and the
modern. The refrain of the Muslim dynasties with its architectural delights, give the majestic
ambience of the bygone era.
On the other side New Delhi, the imperial city built by British, reflect the first paced. The most
fascinating of all is the character of Delhi which varies from the 13th present century mausoleum of
the Lodi kings to ultra modern glass skyscrapers.
SOURCE CODE:
<!DOCTYPE html>
<html>
<head>
<title> paragraph</title>
</head>
<body background="ray-hennessy.jpg">
<h1 align="center" >
<u>New Delhi </u>
</h1>
<p>
New Delhi, the capital and the third largest city of India is fusion of the
ancient and the modern. The refrain of the Muslim dynasties with its
architectural delights, give the majestic ambience of the bygone era.
</p>
<p>
On the other side New Delhi, the imperial city built by British, reflect the first
paced. The most fascinating of all is the character of Delhi which varies from
the 13th present century mausoleum of the Lodi kings to ultra modern glass
skyscrapers.
</p>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<head>
<title>forms</title>
</head>
<body>
<form>
username: <input type="text" name="name">
<br>
<br>
password: <input type="password" name="rollno">
<br>
<br>
when user types characters in a password field,the browser displays asterisks or bullets
instead of characters
<br>
<br>
OUTPUT:
SOURCE CODE:
<html>
<head>
<title>forms</title>
</head>
<body>
<form>
FIRSTNAME: <input type="text" name="fname"><br><br>
LASTNAME: <input type="text" name="lname"><br><br>
GENDER:<br>
male<input type="radio" name="gender" value="male">
female<input type="radio" name="gender" value="female"><br><br>
SUBJECTS:
<select name="subjects">
<option value="multimedia">multimedia</option>
<option value="operating_system">operating system</option>
<option value="csa">CSA</option>
</select><br><br>
<input type="button" name="submit" value="submit query">
</form>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<head>
<title>forms</title>
</head>
<body>
<form>
enter your name: <input type="text" name="fname"><br><br>
enter your rollno: <input type="text" name="lname"><br><br>
SUBJECTS:<br>
<input type="checkbox" name="subject1" value="java">JAVA<br>
<input type="checkbox" name="subject2" value="c">C<br>
<input type="checkbox" name="subject3" value="VB">Visual Basic<br>
<input type="checkbox" name="subject4" value="c++">C++<br><br>
Class:
<select name="class">
<option value="bca1">BCA1</option>
<option value="bca2">BCA2</option>
<option value="bca3">BCA3</option>
</select><br><br>
<input type="button" name="submit" value="submit query">
</form>
</body>
</html>
OUTPUT:
SOURCE CODE:
<!DOCTYPE html>
<head><title> list </title>
</head>
<body>
C<sub>2</sub>H<sub>5</sub>OH
+PCL<sub>5</sub>=C<sub>2</sub>H<sub>5</sub>CL
+POCL<sub>3</sub>+HCL
<br/>
4H<sub>3</sub>PO<sub>3</sub>=3H<sub>3</sub>PO<sub>4</sub>
+PH<sub>3</sub>
<br/>
PCL<sub>3</sub>+CL<sub>2</sub>=PCL<sub>5</sub>
</body>
</html>
SOURCE CODE:
<html>
<head><title> list format </title>
</head>
<body>
<ol type="1">
<li>Actors
<ol type="1">
<li>Bruce Willis</li>
<li>Gerard Butler</li>
<li>Vin Diesel</li>
<li>Bradd Pitt</li>
</ol>
</li>
<li>Actress
<ol type="1">
<li>Julia Roberts</li>
<li>Angelina Jolie</li>
<li>Kate Winslet</li>
<li>Cameron Diaz</li>
</ol>
</li>
</ol>
</body>
<html>
OUTPUT:
SOURCE CODE:
<!DOCTYPE html>
<head>
<title> list format </title>
</head>
<body>
<ol type="1">
<li>Cricket players
<ol type="1">
<li>Batsman
<ol type="1">
<li>SachinTendulkara</li>
<li>Rahul Dravid </li>
<li>Virendrasehwag</li>
</ol>
</li>
<li>Bowler
<ol type="1">
<li>Kumbale</li>
<li>Zaheer Khan</li>
<li>Balaji</li>
</ol>
</li>
<li>Spinner
<ol type="1">
<li>Harbhajan</li>
<li>Kumbale</li>
<li>Jadeja</li>
</ol>
</li>
</ol>
</body>
</html>
OUTPUT:
CSS
1.Create a simple webpage using external CSS.
SOURCE CODE:
HTML FILE:
<html>
<head>
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>MAIC College </h1>
<h2>Maharaja Agrasen International College (MAIC) is affiliated to PanditRavishankar
Shukla University, Raipur,Chhattisgarh.
</h2>
<p> Located in the centre of the city in Samta Colony, it provides quality education.
Established by the Maharaja Agrasen Charitable Trust in 2006, the college has evolved into
one of the premier institutions of the Chhattisgarh with a National Assessment and
Accreditation Council (NAAC) B+ grade in the year 2017.
</p>
</body>
</html>
STYLE.CSS FILE
<style>
body {
background-color: beige;
}
h1 {
text-align: center;
background-color: chocolate;
}
p {
font-family: cursive;
}
</style>
OUTPUT:
2. Change the font size of the following paragraph to large by using the class
selector and emphasize the text “array”.
Array
An array is defined as the collection of similar type of data items stored at contiguous
memory location.
The array is the simplest data structure where each data element can be randomly accessed
by using its index number.
SOURCE CODE:
<html>
<head>
<title>Document</title>
<style>
.para {
font-size: large;
}
</style>
</head>
<body>
<h1>Array</h1>
<p class="para">An <em>array</em> is defined as the collection of similar type of data
items stored at contiguous memory location.</p>
<p class="para">The <em>array</em> is the simplest data structure where each data
element can be randomly accessed by using its index number.</p>
</body>
</html>
OUTPUT:
3. Write the code using an embedded style sheet to make the heading and image
center, If the image cannot be displayed set the alternate text “Image failed to
load”.
SOURCE CODE:
<html>
<head>
<title>Document</title>
<style>
h1 {
text-align: center;
}
img {
display: block;
width: 50%;
margin: auto;
}
</style>
</head>
<body>
<h1>This is image</h1>
<img src="tech.jpg" alt="image failed to load">
</body>
</html>
OUTPUT:
4. Write the HTML and CSS code and use the universal selector.
SOURCE CODE:
<html>
<head>
<title>Document</title>
<style>
*{
color: rgb(7 45 43);
background-color: bisque;
font-family: cursive;
}
</style>
</head>
<body><h1>MAIC College </h1>
<h2>MAIC is one of the premier institutions of Raipur the capital city of Chhattisgarh state.
</h2><p>MAIC is run by Shree Maharaja Agrasen Charitable Trust. The Trustees of MAIC
are the prestigious Dignitaries associated with the Economic and Social development of this
state.</p>
</body>
</html>
OUTPUT:
JAVASCRIPT
Q1. Create a script using for loop to print prime numbers between 1
and 50.
SOURCE CODE:
<html>
<head>
<title>JavaScript Prime</title>
</head>
<body>
<script>
for (var limit = 1; limit <= 50; limit++)
{
var a = false;
for (var i = 2; i <= limit; i++)
{
if (limit%i===0 && i!==limit)
{
a = true;
}
}
if (a === false)
{
document.write("<br>"+limit);
}
}
</script>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<head>
<title>
JAVA
</title>
</head>
<body style="text-align:center;font-size: 24px;"> ENTER THE NUMBER ->
<input id="num">
<br><br>
<button onclick="FACT()">FACTORIAL</button>
<p id="answer"></p>
<script>
function FACT()
{
var i,num,ans;
ans=1;
num = document.getElementById("num").value;
for(i=1;i<=num;i++)
{
ans*=i;
}
document.getElementById("answer").innerHTML = +ans;
}
</script>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<head>
<title> PRACTICAL 24 </title>
</head>
<body style="text-align:center;font-size: 24px;">
</body>
ENTER FIRST NUMBER :- <input id="num1"><br>
ENTER SECOND NUMBER :-<input id="num2">
<br><br>
<button onclick="answer()">CLICK</button>
<p id="ans1"></p>
<p id="ans2"></p>
<script>
function answer()
{
var num1,num2,ans1=0,ans2=1;
num1 =parseInt(document.getElementById("num1").value);
num2 = parseInt(document.getElementById("num2").value);
ans1 = num1 + num2;
OUTPUT:
SOURCE CODE:
<html>
<body>
<script>
function validateform()
var name=document.getElementById("name");
var password=document.getElementById("password");
if (name.value==null || name.value=="")
{
alert("Name can't be blank");
return false;
}
else if(password.value.length<6)
{
alert("Password must be at least 6 characters long.");
return false;
}
</script>
<form method="get" onsubmit="return validateform()" action="register.html">
<table>
<tr>
<td>Enter Name: </td>
<td><input type="text" id="name"/></td>
</tr>
<tr>
<td>Password: </td>
<td><input type="password" id="password"/></td>
</tr>
</table>
<input type="submit" value="submit">
</form>
</body>
</html>
OUTPUT:
SOURCE CODE:
<html>
<body>
<div class="container"> This is a page
</div>
<script>
alert("Hello there");
let name =prompt("what is your name?","guest");
console.log(name);
let health= confirm("How are you today?");
if(health)
{
console.log("Great!!. May your tomorrow be great too");
}
else
{
console.log("Not Great!!.Well tomorrow will be the greatest");
}
</script>
</body>
</html>
OUTPUT: