Lab Programs
Lab Programs
Zoom and Google Meet are popular digital communication tools that allow
users to conduct online meetings, webinars, and video conferences. These
platforms heavily rely on Voice Over Internet Protocol (VOIP) technology for
their functionality: VOIP is a technology that allows voice calls to be made
using an internet connection instead of a regular analog phone line. Essentially,
it converts the voice signals into digital signals, which are then transmitted over
the internet. This technology facilitates real-time audio communication during
meetings on Zoom and Google Meet. The use of VOIP technology ensures that
both platforms can provide high-quality audio transmission, resulting in
efficient and effective communication regardless of the participants'
geographical locations.
<!DOCTYPE html>
<html>
<body>
<form action="/submit" method="post">
<label for ="fname">First Name:</label><br>
<input type="text" id="fname" name="fname"><br><br>
<label for="gender">Gender:</label><br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label><br>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label><br><br>
<label for="interests">Interests:</label><br>
<input type="checkbox" id="sports" name="interests" value="sports">
<label for="sports">Sports</label><br>
<input type="checkbox" id="music" name="interests" value="music">
<label for="music">Music</label><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Program 4. Create a simple HTML page by using some of the basic tags
(hyperlink, marque image)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple HTML Page</title>
</head>
<body>
</body>
</html>
output
Program 5 : Create a web page with multiple types of style sheet used in a
single page
Step 1: Create below CSS and Save as external.css in a chosen directory (For
example: D:/HTML)
/*external.css*/
h3 {
color:darkgreen;
font-family: Arial, sans-serif;
}
p.external-paragraph (
color: darkblue;
font-family: Verdana, sans-serif;
font-size: 18px;
}
Step 2: Create HTML File and Save as CSSDemo.html in the same directory
(For example: D:/HTML)
<html>
<head>
<title>Page with Different CSS Styles</title>
<style>
h1{
color: red;
font-family: 'Times New Roman', Times, serif;
}
p. Internal-paragraph {
color: orange;
font-family: Georgia, serif;
font-size: 45px;
</style>
<link rel="stylesheet" type="text/css" href="C:\Users\admin\Desktop\ex.css">
</head>
<body>
<h1 style="color:blue; font-family:Helvetica;">This is a Heading with Inline
CSS.</h1>
<p style="color:purple; font-family:Helvetica;">This is a paragraph with inline
CSS.</p>
<h2>This is a Heading with Internal CSS</h2>
<p class="internal-paragraph">This is a paragraph with internal CSS.</p>
<h3>This is a Heading with External CSS</h3>
<p class="external-paragraph">This is a paragraph with external CSS.</p>
</body>
</html>
Program 6 Write a CGI sample program to send output back to the user
Common Gateway Interface (CGI) is a standard method used by web servers to
interact with backend applications. It can be used to create dynamic content on
web pages and is supported by a wide variety of languages including Python,
Perl, C, C++, and so on. For the purpose of this program, Python will be used to
create a simple CGI script that will return an output to the user. The following
steps will guide through the process of setting up the environment in a Windows
system, starting from installing the Apache server and Python, configuring
Apache to support CGI, and finally writing and running the CGI program.
<!DOCTYPE html>
<html>
<head>
<title>Time Table</title>
</head>
<body>
<h2>Weekly Class Schedule</h2>
<table border="1">
<tr>
<th>Day</th>
<th>9:00- 10:00</th>
<th>10:00- 11:00</th>
<th>11:30 -12:30</th>
</tr>
<tr>
<td>Monday</td>
<td>Internet Technologies</td>
<td>Software Engineering</td>
<td>The Design and Analysis of Algorithms</td>
</tr>
<tr>
<td>Tuesday</td>
<td>Internet Technologies</td>
<td>Software Engineering</td>
<td>The Design and Analysis of Algorithms</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Internet Technologies</td>
<td>Software Engineering</td>
<td>The Design and Analysis of Algorithms</td>
</tr>
<tr>
<td>Thursday</td>
<td>Internet Technologies</td>
<td>Software Engineering</td>
<td>The Design and Analysis of Algorithms</td></tr>
<tr>
<td>Friday</td>
<td>Internet Technologies</td>
<td>Software Engineering</td>
<td>The Design and Analysis of Algorithms</td>
</tr>
</table>
</body>
</html>
Output
Code menu.html
<!DOCTYPE html>
<html>
<body>
<h2>Menu</h2>
<ul>
<li>Biryani</li>
<li>Butter Chicken</li>
<li>Paneer Tikka</li>
<li>Dal Makhani</li>
</ul>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Content</h2>
<p>Welcome to our Indian food restaurant! we serve a variety of delicious
dishes.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>Info</h2>
<p>We are located at Main Street and open from 10am to 10pm everyday.</p>
</body>
</html>
Code main.html
<!DOCTYPE html>
<html>
<frameset cols="20%, 60%, 20%">
<frame src="menu.html" name="menu_frame">
<frame src="content.html" name="content_frame">
<frame src="info.html" name="info_frame">
</frameset>
</html>
Program 9 Write a java script program to create dialogue boxes using alert,
confirm and prompt methods
<!DOCTYPE html>
<html>
<head>
<title>Newsletter Subscription</title>
<script type="text/javascript">
function subscribeNewsletter() {
// Alert the user about the newsletter
alert("Welcome to our website! We offer a weekly newsletter");
if (subscribe) {
// Ask for the user's email address
var email = prompt("Please enter your email address for the subscription:",
"");
if (email) {
// If the user provided an email, show a thank you message
alert("Thanks. You will receive a confirmation email at " + email + ".");
} else {
// The user clicked "Cancel" or entered an empty email address
alert("You did not provide an email address. No subscription has been
made.");
}
} else {
// The user clicked "Cancel" on the confirm dialog
alert("No problem, you can always subscribe later if you change your
mind.");
}
}
</script>
</head>
<body onload="subscribeNewsletter()">
<h1>Welcome to our Website!</h1>
</body>
</html>
output
Program 10 Write a java script program on Form Validations.
<!DOCTYPE html>
<html>
<head>
<title>Form Validation</title>
<style>
.error { color: red; }
</style>
</head>
<body>
<h2>Registration Form</h2>
<form id="registrationForm" onsubmit="return validateForm()">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br>
<span id="nameError" class="error"></span><br>
<label for="email">Email:</label><br>
<input type="text" id="email" name="email"><br>
<span id="emailError" class="error"></span><br>
<label for="password">Password:</label><br>
<input type="password" id="password" name="password"><br>
<span id="passwordError" class="error"></span><br>
<br>
<input type="submit" value="Register">
</form>
<script>
function validateForm() {
let valid = true;
// Get values
const name = document.getElementById('name').value.trim();
const email = document.getElementById('email').value.trim();
const password = document.getElementById('password').value;
const confirmPassword =
document.getElementById('confirmPassword').value;
// Name validation
if (name === '') {
document.getElementById('nameError').textContent = 'Name is required.';
valid = false;
}
// Email validation
const emailPattern = /^[^ ]+@[^ ]+\.[a-z]{2,3}$/;
if (email === '') {
document.getElementById('emailError').textContent = 'Email is required.';
valid = false;
} else if (!email.match(emailPattern)) {
document.getElementById('emailError').textContent = 'Invalid email format.';
valid = false;
}
// Password validation
if (password.length < 6) {
document.getElementById('passwordError').textContent = 'Password must be
at least 6 characters.';
valid = false;
}
</body>
</html>
output
Program 11 Write a Java script program is perform four arithmatic operations:
Addition, subtraction ,Multiplication and Division on two numbers.
<!DOCTYPE html>
<html>
<head>
<title>Arithmetic Operations</title>
<script type="text/javascript">
function performOperations() {
// Retrieve numbers from the form
var num1 = parseFloat(document.getElementById("number1").value);
var num2 = parseFloat(document.getElementById("number2").value);
if (num2 !== 0) {
document.getElementById("division").innerHTML = "Division: " + (num1
/ num2);
} else {
document.getElementById("division").innerHTML = "Division: Cannot
divide by zero";
}
}
</script>
</head>
<body>
<h1>Arithmetic Operations</h1>
<form>
Number 1: <input type="number" id="number1"><br><br>
Number 2: <input type="number" id="number2"><br><br>
<input type="button" value="Calculate" onclick="performOperations()">
</form>
<p id="addition"></p>
<p id="subtraction"></p>
<p id="multiplication"></p>
<p id="division"></p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>BMC Institute of Computer Applications</title>
<style>
body {
font-family: Arial, sans-serif;}
header {
background-color: #f8f9fa;
padding: 20px;
text-align: center;
}
nav {
margin: 20px 0;
text-align: center;
}
nav a {
margin: 0 15px;
}
</style>
</head>
<body>
<header>
<img src="logo.jpg" alt="BMC Institute of Computer Applications Logo"
width="100">
<h1>BMC Institute of Computer Applications</h1>
<p>157, 3RD MAIN, CHAMRAJPET BANGALORE 560018</p>
</header>
<nav>
<a href="index.html">Home</a>
<a href="about.html">About Us</a>
<a href="courses.html">Courses</a>
<a href="contact.html">Contact Us</a>
</nav>
<main>
<h2>Welcome to Skyward Institute of Computer Applications</h2>
<p>We provide best training on computer application courses.</p>
</main>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Courses BMC Institute of Computer Applications</title>
</head>
<body>
<h1>Courses</h1>
<h2>BCA</h2>
<h2>MCA</h2>
</body>
</html>
OUTPUT