Mean Stack
Mean Stack
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
header {
background-color: #007BFF;
color: white;
text-align: center;
padding: 1rem;
nav {
background-color: #f4f4f4;
padding: 1rem;
text-align: center;
21
nav a {
margin: 0 1rem;
text-decoration: none;
color: #007BFF;
font-weight: bold;
nav a:hover {
text-decoration: underline;
.content {
padding: 2rem;
section {
margin-bottom: 2rem;
footer {
background-color: #f4f4f4;
text-align: center;
padding: 1rem;
margin-top: 2rem;
table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
th, td {
22
text-align: center;
padding: 10px;
th {
background-color: #007BFF;
color: white;
tr:nth-child(even) {
background-color: #f9f9f9;
</style>
</head>
<body>
<header>
<h1>Welcome to IEKart</h1>
</header>
<nav>
<a href="Login.html">Login</a>
<a href="#electronics">Electronics</a>
<a href="#fashion">Fashion</a>
</nav>
<div class="content">
23
<section id="electronics">
<h2>Electronics</h2>
<p>Explore a wide range of electronics including smartphones, laptops, cameras, and accessories.</p>
<table>
<thead>
<tr>
<th rowspan="2">Brand</th>
<th rowspan="2">Model</th>
<th rowspan="2">Price</th>
<th colspan="2">Availability</th>
</tr>
<tr>
<th>Stock</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Samsung</td>
<td>Galaxy S23</td>
<td>$999</td>
<td>Available</td>
<td>Warehouse 1</td>
</tr>
24
<tr>
<td>2</td>
<td>Apple</td>
<td>iPhone 14</td>
<td>$1099</td>
<td>Limited Stock</td>
<td>Warehouse 2</td>
</tr>
<tr>
<td>3</td>
<td>Xiaomi</td>
<td>$299</td>
<td>Out of Stock</td>
<td>N/A</td>
</tr>
</tbody>
</table>
</section>
<section id="fashion">
<h2>Fashion</h2>
<p>Discover the latest trends in fashion with our collection of clothing, footwear, and accessories for
men, women, and kids.</p>
</section>
<section id="home-appliances">
<h2>Home Appliances</h2>
25
<p>Upgrade your home with our range of appliances including refrigerators, washing machines, and
kitchen gadgets.</p>
</section>
</div>
<footer>
</footer>
</body>
</html>
Output:
26
2.b Course Name: HTML5 - The Language
Module Name: Creating Form Elements, Color and Date Pickers, Select and Datalist Elements
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IEKart Sign-Up</title>
<style>
body {
margin: 0;
padding: 0;
background-color: #f9f9f9;
header {
background-color: #007BFF;
color: white;
text-align: center;
padding: 1rem;
.container {
width: 90%;
max-width: 500px;
background: white;
padding: 2rem;
27
border-radius: 8px;
h2 {
text-align: center;
margin-bottom: 1.5rem;
color: #333;
label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
color: #555;
width: 100%;
padding: 10px;
margin-bottom: 1rem;
border-radius: 5px;
font-size: 1rem;
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
button:hover {
28
background-color: #0056b3;
.small-text {
font-size: 0.9rem;
color: #777;
</style>
</head>
<body>
<header>
</header>
<div class="container">
<label for="password">Password</label>
29
<!-- Date of Birth -->
<label for="gender">Gender</label>
<option value="">Select</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<datalist id="categories">
<option value="Electronics">
<option value="Fashion">
<option value="Books">
<option value="Sports">
</datalist>
30
<!-- Address -->
<label for="address">Address</label>
<label>
</label>
</form>
</div>
</body>
</html>
31
Output:
32
Module Name: Input Elements - Attributes
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
background-color: #f9f9f9;
header {
background-color: #007BFF;
color: white;
text-align: center;
padding: 1rem;
.container {
width: 90%;
max-width: 500px;
background: white;
padding: 2rem;
33
border-radius: 8px;
h2 {
text-align: center;
margin-bottom: 1.5rem;
color: #333;
label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
color: #555;
width: 100%;
padding: 10px;
margin-bottom: 1rem;
border-radius: 5px;
font-size: 1rem;
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
button:hover {
34
background-color: #0056b3;
.small-text {
font-size: 0.9rem;
color: #777;
</style>
</head>
<body>
<header>
</header>
<div class="container">
autocomplete="email">
<label for="password">Password</label>
35
required minlength="8" maxlength="20" autocomplete="new-password"
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}"
title="Password must be 8-20 characters and include at least one number, one uppercase letter,
and one lowercase letter.">
required autocomplete="new-password">
<label for="gender">Gender</label>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
36
<label for="category">Preferred Shopping Category</label>
<datalist id="categories">
<option value="Electronics">
<option value="Fashion">
<option value="Books">
<option value="Sports">
</datalist>
<label for="address">Address</label>
required pattern="[0-9]{10}"
<label>
</label>
37
</form>
</div>
</body>
</html>
Output:
38
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
background-color: #f9f9f9;
header {
background-color: #007BFF;
color: white;
text-align: center;
padding: 1rem;
nav {
background-color: #f4f4f4;
padding: 1rem;
text-align: center;
nav a {
margin: 0 1rem;
text-decoration: none;
39
color: #007BFF;
font-weight: bold;
nav a:hover {
text-decoration: underline;
.content {
padding: 2rem;
section {
margin-bottom: 2rem;
.media-section {
text-align: center;
margin-top: 2rem;
iframe {
border: none;
width: 100%;
max-width: 600px;
height: 315px;
audio, video {
display: block;
max-width: 100%;
footer {
40
background-color: #f4f4f4;
text-align: center;
padding: 1rem;
margin-top: 2rem;
</style>
</head>
<body>
<header>
<h1>Welcome to IEKart</h1>
</header>
<nav>
<a href="Login.html">Login</a>
<a href="#electronics">Electronics</a>
<a href="#fashion">Fashion</a>
</nav>
<div class="content">
<section id="electronics">
<h2>Electronics</h2>
<p>Explore a wide range of electronics including smartphones, laptops, cameras, and accessories.</p>
</section>
41
<section id="fashion">
<h2>Fashion</h2>
<p>Discover the latest trends in fashion with our collection of clothing, footwear, and accessories for
men, women, and kids.</p>
</section>
<section id="home-appliances">
<h2>Home Appliances</h2>
<p>Upgrade your home with our range of appliances including refrigerators, washing machines, and
kitchen gadgets.</p>
</section>
<section class="media-section">
<iframe
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
allowfullscreen>
</iframe>
<audio controls>
42
Your browser does not support the audio element.
</audio>
<video controls>
</video>
</section>
</div>
<footer>
</footer>
</body>
</html>
Output:
43
3a)Course Name: Javascript
44
Module Name: Type of Identifiers
Program:
(Index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Area of a Circle</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
45
h1 {
color: #333;
}
label {
font-size: 18px;
margin-bottom: 10px;
display: block;
}
input[type="number"] {
width: 80%;
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
border: 1px solid #ccc;
}
button {
background-color: #28a745;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #218838;
46
}
#result {
margin-top: 20px;
font-size: 18px;
color: #555;
}
</style>
</head>
<body>
<div class="container">
<h1>Calculate the Area of a Circle</h1>
<label for="radius">Enter the radius:</label>
<input type="number" id="radius" required>
<button onclick="calculateArea()">Calculate Area</button>
<p id="result"></p>
</div>
<script src="script.js"></script>
</body>
</html>
(Script.js)
// Define PI as a constant
const PI = 3.14159;
function calculateArea() {
// Using var for radius
var radius = document.getElementById('radius').value;
// Convert radius to a number
47
radius = Number(radius);
Output:
48
Program:
(MovieDetails.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Details</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #007BFF;
}
.movie-details {
border: 1px solid #ccc;
padding: 15px;
margin-top: 20px;
border-radius: 5px;
background-color: #f9f9f9;
}
p{
margin: 10px 0;
}
</style>
</head>
<body>
<h1>Movie Details</h1>
<div class="movie-details" id="movieDetails"></div>
(Script.js)
49
// Primitive data types
const movieName = "Inception"; // String
const language = "English"; // String
const rating = 8.8; // Number
Output:
50
51
3c)Course Name: Javascript
Module Name: Operators and Types of Operators
Program:
(TicketBooking.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Ticket Booking</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #007BFF;
}
input, button {
margin: 10px 0;
padding: 10px;
font-size: 16px;
}
#result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Book Movie Tickets</h1>
<label for="tickets">Enter number of tickets:</label>
<input type="number" id="tickets" placeholder="Number of tickets" step="1">
<button onclick="calculateTotal()">Calculate Total</button>
<p id="result"></p>
52
<!-- Link to JavaScript -->
<script src="TicketScript.js"></script>
</body>
</html>
(ticketBooking.js)
// Constants
const TICKET_PRICE = 150; // Price per ticket in Rs
const FESTIVE_DISCOUNT = 10; // Discount percentage
Output:
53
54
3d)Course Name: Javascript
Module Name: Types of Statements, Non - Conditional Statements, Types of Conditional
Statements, if Statements, switch Statements
Program:
(TicketBooking.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Ticket Booking</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #007BFF;
}
input, button {
margin: 10px 0;
padding: 10px;
font-size: 16px;
}
#result {
margin-top: 20px;
font-weight: bold;
}
55
</style>
</head>
<body>
<h1>Book Movie Tickets</h1>
<label for="tickets">Enter number of tickets:</label>
<input type="number" id="tickets" placeholder="Number of tickets" step="1">
<button onclick="bookTickets()">Book Tickets</button>
<p id="result"></p>
(TicketBooking.js)
// Constants
const BASE_TICKET_PRICE = 150; // Cost per ticket
56
let totalPrice = 0; // Variable to hold the total price
57
Output:
58
3e)Course Name: Javascript
Module Name: Types of Loops
Program:
(TicketBooking.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Ticket Booking</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #007BFF;
}
input, button {
margin: 10px 0;
padding: 10px;
font-size: 16px;
}
#result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>Book Movie Tickets</h1>
<label for="tickets">Enter number of tickets:</label>
<input type="number" id="tickets" placeholder="Number of tickets" step="1">
<button onclick="bookTickets()">Book Tickets</button>
<p id="result"></p>
59
(TicketBooking.js)
// Constants
const BASE_TICKET_PRICE = 150; // Cost per ticket (Condition A)
const DISCOUNTED_TICKET_PRICE = 130; // Cost per ticket for 3-5 tickets (Condition C)
60
// Condition A: Tickets ≤ 2, price is Rs. 150 each
totalPrice += BASE_TICKET_PRICE;
} else {
// Condition C: Tickets between 3 and 5, price is Rs. 130 each
totalPrice += DISCOUNTED_TICKET_PRICE;
}
}
61
Output:
62
4a)Course Name: Javascript
Module Name: Types of Functions, Declaring and Invoking Function, Arrow Function,
Function Parameters, Nested Function, Built-in Functions, Variable Scope in Functions
Program:
(TicketBooking.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie Ticket Booking</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #007BFF;
}
input, button {
margin: 10px 0;
padding: 10px;
font-size: 16px;
}
#result {
margin-top: 20px;
font-weight: bold;
}
</style>
63
</head>
<body>
<h1>Book Movie Tickets</h1>
<label for="tickets">Enter number of tickets:</label>
<input type="number" id="tickets" placeholder="Number of tickets" step="1">
<button onclick="handleBooking()">Book Tickets</button>
<p id="result"></p>
(Script.js)
// Constants for ticket prices
const BASE_TICKET_PRICE = 150;
const DISCOUNTED_TICKET_PRICE = 130;
64
const result = calculateTotal(numberOfTickets);
document.getElementById("result").innerHTML = result;
}
65
// Return result as a string
return `
<p>Number of Tickets: ${tickets}</p>
<p>Total Price: Rs. ${totalPrice}</p>
`;
}
Output:
66
4b)Course Name: Javascript
Module Name: Working With Classes, Creating and Inheriting Classes
Program:
// Base class: Person
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
// Example usage
const person = new Person("John Doe", 30);
console.log(person.getDetails());
67
Output:
68
4c)Course Name: Javascript
Module Name: In-built Events and Handlers
Program:
(ticketBooking.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 20px;
h1 {
color: #007BFF;
input, button {
margin: 10px 0;
padding: 10px;
font-size: 16px;
#result {
margin-top: 20px;
font-weight: bold;
69
</style>
</head>
<body>
<p id="result"></p>
<script src="script.js"></script>
</body>
</html>
(script.js)
// Constants for ticket pricing
function bookTickets(event) {
70
// Check for valid input
return;
if (numberOfTickets >= 6) {
return;
let totalPrice;
if (numberOfTickets <= 2) {
} else {
displayMessage(
"success"
);
71
const resultElement = document.getElementById("result");
resultElement.innerHTML = message;
document.getElementById("bookButton").addEventListener("click", bookTickets);
Output:
72
4d)Course Name: Javascript
Module Name: Working with Objects, Types of Objects, Creating Objects, Combining and
cloning Objects using Spread operator, Destructuring Objects, Browser Object Model, Document
Object Mode.
Program:
(cone.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Interactive Cone</title>
<style>
body {
text-align: center;
margin: 0;
padding: 0;
h1 {
margin: 20px 0;
p{
font-size: 18px;
img {
width: 150px;
73
height: auto;
margin: 20px 0;
a{
display: inline-block;
margin-top: 20px;
text-decoration: none;
font-size: 18px;
color: white;
background-color: #007BFF;
border-radius: 5px;
a:hover {
background-color: #0056b3;
</style>
</head>
<body>
<h1 id="heading">Welcome!</h1>
<br>
<script src="script.js"></script>
74
</body>
</html>
(script.js)
// Initial state object
let coneState = {
empty: {
message: "Oh no! The cone is empty. Click again to refill it.",
image: "empty-cone.png",
backgroundColor: "#f0e68c",
},
filled: {
image: "filled-cone.png",
backgroundColor: "#ffcccb",
},
};
function updateUI(state) {
75
const { heading, message, image, backgroundColor } = state;
headingElement.innerText = heading;
messageElement.innerText = message;
coneImageElement.src = image;
document.body.style.backgroundColor = backgroundColor;
coneState.isEmpty = !coneState.isEmpty;
updateUI(currentState);
});
updateUI(coneState.empty);
76
output:
77
5a)Course Name: Javascript
Module Name: Creating Arrays, Destructuring Arrays, Accessing Arrays, Array Methods
Program:
(Movies.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Movie List</title>
<style>
body {
margin: 20px;
h1 {
color: #007BFF;
.movie {
margin: 10px 0;
padding: 10px;
border-radius: 5px;
background-color: #f9f9f9;
.movie h2 {
78
margin: 0;
color: #333;
.movie p {
margin: 5px 0;
</style>
</head>
<body>
<h1>Movie Details</h1>
<div id="moviesContainer"></div>
<script src="script.js"></script>
</body>
</html>
(script.js)
// Array of movie objects
const movies = [
{
name: "Inception",
starring: ["Leonardo DiCaprio", "Joseph Gordon-Levitt", "Elliot Page"],
language: "English",
ratings: 8.8,
},
{
name: "Parasite",
starring: ["Song Kang-ho", "Lee Sun-kyun", "Cho Yeo-jeong"],
language: "Korean",
ratings: 8.6,
},
{
name: "The Dark Knight",
79
starring: ["Christian Bale", "Heath Ledger", "Aaron Eckhart"],
language: "English",
ratings: 9.0,
},
{
name: "3 Idiots",
starring: ["Aamir Khan", "R. Madhavan", "Sharman Joshi"],
language: "Hindi",
ratings: 8.4,
},
];
80
Output:
81
5b)Course Name: Javascript
Module Name: Introduction to Asynchronous Programming, Callbacks, Promises, Async and
Await, Executing Network Requests using Fetch API
Program:
(stockPriceSimulation.js)
// Helper function to generate a random stock price
function getRandomStockPrice() {
count++;
82
clearInterval(intervalId);
simulateStockPrices();
Output:
83
5c) Course Name: Javascript
Module Name: Creating Modules, Consuming Modules
Program:
(login.js)
// login.js
constructor(username, password) {
this.username = username;
this.password = password;
validate(inputUsername, inputPassword) {
} else {
(main.js)
// main.js
84
// Simulate user input
console.log(result);
alert(result);
(Main.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login Validation</title>
</head>
<body>
<p>Open the browser console to see the result of your login attempt.</p>
</body>
</html>
85
Output:
86
87