Web Development
Web Development
Technology,
Greater Noida, Uttar Pradesh
Bachelor of Technology In
Session 2024-25
Web Technology Lab
Subject Code: BCS-552
10
11
12
13
14
<section>
<h2>About the College</h2>
<p>
Galgotia College of Engineering and Technology (GCET) is a prestigious
institution that offers quality education in various fields of
engineering and technology. With a community of over 1500 students and
500+ faculty members, the college is dedicated to fostering innovation
and excellence.
</p>
<h2>Departments</h2>
<div class="departments">
<ul>
<li>Computer Science and Engineering</li>
<li>Electronics and Communication Engineering</li>
<li>Mechanical Engineering</li>
<li>Civil Engineering</li>
<li>Electrical Engineering</li>
<li>Information Technology</li>
</ul>
</div>
<h2>College Statistics</h2>
<div class="stats-table">
<table>
<tr>
<th>Department</th>
<th>Number of Students</th>
<th>Number of Faculty</th>
<th>Lab Facilities</th>
</tr>
<tr>
<td>Computer Science and Engineering</td>
<td>500+</td>
<td>100+</td>
<td>AI & Machine Learning, Data Science Labs</td>
</tr>
<tr>
<td>Electronics and Communication Engineering</td>
<td>300+</td>
<td>80+</td>
<td>Embedded Systems, Circuit Design Labs</td>
</tr>
<tr>
<td>Mechanical Engineering</td>
<td>250+</td>
<td>70+</td>
<td>Thermal, Manufacturing Labs</td>
</tr>
<tr>
<td>Civil Engineering</td>
<td>200+</td>
<td>60+</td>
<td>Structural Analysis, Geotechnical Labs</td>
</tr>
<tr>
<td>Electrical Engineering</td>
<td>150+</td>
<td>50+</td>
<td>Power Systems, Control Systems Labs</td>
</tr>
<tr>
<td>Information Technology</td>
<td>100+</td>
<td>40+</td>
<td>Web Development, Cybersecurity Labs</td>
</tr>
</table>
</div>
</section>
</body>
</html>
Output:
Experiment No: 2
Aim: Write HTML program to design an entry form for student details/employee
information/faculty details.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Comprehensive Form</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f4f4f4;
margin: 0;
}
form {
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 500px;
width: 100%;
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
}
input, select, textarea {
width: 100%;
padding: 8px;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-actions {
text-align: center;
}
</style>
</head>
<body>
<form>
<h2>Comprehensive Form</h2>
</body>
</html>
Output
Experiment 3
Aim: Develop a responsive website using CSS and HTML. Website may be for
tutorial/blogs commercial website.Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple Bookstore</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f4f4f4;
}
.container {
max-width: 800px;
width: 100%;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1,
h2 {
color: #004aad;
text-align: center;
}
.book-list,
.cart-list {
margin-top: 20px;
}
.book,
.cart-item {
display: flex;
justify-content: space-between;
padding: 10px;
border: 1px solid #ddd;
margin-bottom: 10px;
border-radius: 5px;
}
button {
background-color: #004aad;
color: white;
border: none;
padding: 8px 12px;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #00337d;
}
.cart-total {
text-align: right;
margin-top: 10px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>Online Bookstore</h1>
<h2>Available Books</h2>
<script>
const cart = [];
cartList.innerHTML = "";
let total = 0;
cart.forEach((item) => {
const itemTotal = item.price * item.quantity;
total += itemTotal;
Output
Experiment 4
Aim: Write a program in XML for creation of DTD, which specifies set of rules.
Create a style sheet in CSS/ XSL & display the document in internet explorer.
Code
XML File (students.xml)
<?xml version="1.0"?>
<!DOCTYPE students [
<!ELEMENT students (student*)>
<!ELEMENT student (name, rollno, department)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT rollno (#PCDATA)>
<!ELEMENT department (#PCDATA)>
]>
<?xml-stylesheet type="text/css" href="styles.css"?>
<students>
<student>
<name>John Doe</name>
<rollno>12345</rollno>
<department>CSE</department>
</student>
<student>
<name>Jane Smith</name>
<rollno>67890</rollno>
<department>ECE</department>
</student>
</students>
CSS File
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
color: #333;
}
wstudents {
display: block;
margin: 20px;
padding: 10px;
border: 1px solid #ddd;
background-color: #fff;
}
student {
display: block;
margin-bottom: 10px;
padding: 10px;
border: 1px solid #ccc;
background-color: #f9f9f9;
}
name, rollno, department {
display: block;
font-weight: bold;
}
Output
Student List
• John Doe
Roll No: 12345
Department: CSE
• Jane Smith
Roll No: 67890
Department: ECE
Experiment 5
Aim: Create a Java Bean for Employee information (EmpID, Name, Salary,
Designation and Department).
Code
import java.io.Serializable;
// Default Constructor
public Employee() {
// Parameterized Constructor
public Employee(int empID, String name, double salary, String designation, String department) {
this.empID = empID;
this.name = name;
this.salary = salary;
this.designation = designation;
this.department = department;
return empID;
this.empID = empID;
}
// Getter and Setter for Name
return name;
this.name = name;
return salary;
this.salary = salary;
return designation;
this.designation = designation;
return department;
this.department = department;
@Override
public String toString() {
return "Employee Details: [EmpID: " + empID + ", Name: " + name + ", Salary: " + salary +
emp1.setEmpID(101);
emp1.setName("John Doe");
emp1.setSalary(75000.50);
emp1.setDesignation("Software Engineer");
emp1.setDepartment("IT");
System.out.println(emp1);
System.out.println(emp2);
Output
Employee Details: [EmpID: 101, Name: John Doe, Salary: 75000.5, Designation: Software Engineer,
Department: IT]
Employee Details: [EmpID: 102, Name: Jane Smith, Salary: 85000.0, Designation: Project Manager,
Department: Management]
Experiment 6
Aim: Build a command-line utility using Node.js that performs a specific task,
such as converting text to uppercase, calculating the factorial of a number, or
generating random passwords.
Code
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
console.log("4. Exit\n");
};
switch (option) {
case '1':
displayMenu();
});
break;
case '2':
} else {
displayMenu();
});
break;
case '3':
} else {
displayMenu();
});
break;
case '4':
console.log("\nGoodbye!");
rl.close();
break;
default:
displayMenu();
};
};
const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}";
return password;
};
displayMenu();
Output
Enter text to convert to uppercase: hello world
Factorial of 5: 120
Code
const { MongoClient } = require('mongodb');
// Aggregation function
try {
await client.connect();
console.log("Connected to MongoDB");
const db = client.db(dbName);
const pipeline = [
$group: {
_id: "$city",
totalUsers: { $sum: 1 }
}
},
{ $sort: { averageAge: -1 } }
];
console.log("Aggregation Results:");
results.forEach(result => {
});
} catch (err) {
} finally {
await client.close();
};
aggregateUserData();
Output
Connected to MongoDB
Aggregation Results: