Ai&ds HTML
Ai&ds HTML
DEPARTMENT OF
Computer Science And Engineering
Artificial Intelligence And Data Science
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
List of Exercises :
1. Course Name: HTML5 - The Language
a
Module Name: Case-insensitivity, Platform-independency, DOCTYPE Declaration, Types of
Elements, HTML Elements - Attributes, Metadata Element
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_28320667711144660000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_63722913471108
57000_shared?collectionId=lex_1773973283484081000 0_shared&collectionType=Course
Make use of appropriate grouping elements such as list items to "About Us" page of IEKart's
Shopping Application
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_32785192040894940000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
"Track.html" page respectively. Bookmark each category to its details of IEKart's Shopping
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
application.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_15515105953273338000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
Add the © symbol in the Home page footer of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_547667376938096260_shared?collectionId=lex_17739732834840810000
_shared&collectionType=Course
Add the global attributes such as contenteditable, spellcheck, id etc. to enhance the
Signup Page functionality of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_28723566050321920000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
Enhance the details page of IEKart's Shopping application by adding a table element
to display the available mobile/any inventories.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013168035284033536113_shared?collectionId=lex_177397328348
40810000_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Module Name: Creating Form Elements, Color and Date Pickers, Select and Datalist
Elements
Using the form elements create Signup page for IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_13975270903118459000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_14048414537062347000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
Add media content in a frame using audio, video, iframe elements to the Home page
of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_30738402225794945000_shared?collectionId=lex_177397328348408100
00_shared&collectionType=Course
Write a JavaScript program to find the area of a circle using radius (var and let -
reassign and observe the difference with var and let) and PI (const)
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013053264414818304732_shared?collectionId=lex_181096983663
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
32810000_shared&collectionType=Course
Write JavaScript code to display the movie details such as movie name, starring,
language, and ratings. Initialize the variables with values of appropriate types. Use
template literals wherever necessary.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_21528322245232402000_shared?collectionId=lex_181096983663328100
00_shared&collectionType=Course
Write JavaScript code to book movie tickets online and calculate the total price,
considering the number of tickets and price per ticket as Rs. 150. Also, apply a festive
season discount of 10% and calculate the discounted amount.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_13808338384481720000_shared?collectionId=lex_181096983663328100
00_shared&collectionType=Course
Write a JavaScript code to book movie tickets online and calculate the total price
based on the 3 conditions: (a) If seats to be booked are not more than 2, the cost per
ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If se
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_16257498471333610000_shared?collectionId=lex_181096983663328100
00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Write a JavaScript code to book movie tickets online and calculate the total price
based on the 3 conditions: (a) If seats to be booked are not more than 2, the cost per
ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_6238536888292970000_shared?collectionId=lex_1810969836633281000
0_shared&collectionType=Course
Module Name: Types of Functions, Declaring and Invoking Function, Arrow Function,
Function Parameters, Nested Function, Built-in Functions, Variable Scope in
Functions
Write a JavaScript code to book movie tickets online and calculate the total price
based on the 3 conditions: (a) If seats to be booked are not more than 2, the cost per
ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_15455199570613326000_shared?collectionId=lex_181096983663328100
00_shared&collectionType=Course
Create an Employee class extending from a base class Person. Hints: (i) Create a class
Person with name and age as attributes. (ii) Add a constructor to initialize the values
(iii) Create a class Employee extending Person with additional attributes role
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_012599811117760512458_shared?collectionId=lex_181096983663
32810000_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Write a JavaScript code to book movie tickets online and calculate the total price
based on the 3 conditions: (a) If seats to be booked are not more than 2, the cost per
ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If se
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_4192188372573027000_shared?collectionId=lex_1810969836633281000
0_shared&collectionType=Course
Combining and cloning Objects using Spread operator, Destructuring Objects, Browser
Object Model, Document Object Model
If a user clicks on the given link, they should see an empty cone, a different heading,
and a different message and a different background color. If user clicks again, they
should see a re-filled cone, a different heading, a different message, and a diffe
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_13197025862804100000_shared?collectionId=lex_181096983663328100
00_shared&collectionType=Course
Create an array of objects having movie details. The object should include the movie
name, starring, language, and ratings. Render the details of movies on the page using
the array.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013053270191734784711_shared?collectionId=lex_181096983663
32810000_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Simulate a periodic stock price change and display on the console. Hints: (i) Create a
method which returns a random number - use Math.random, floor and other
methods to return a rounded value. (ii) Invoke the method for every three seconds
and stop when
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_012599811633905664460_shared?collectionId=lex_181096983663
32810000_shared&collectionType=Course
Validate the user by creating a login module. Hints: (i) Create a file login.js with a User
class. (ii) Create a validate method with username and password as arguments.
(iii) If the username and password are equal it will return "Login Successful" else w
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013052857053585408667_shared?collectionId=lex_181096983663
32810000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_19002830632103186000_shared?collectionId=lex_324078356719467600
00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_28177338996267815000_shared?collectionId=lex_324078356719467600
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_28865394191004004000_shared?collectionId=lex_324078356719467600
00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_9174073856000159000_shared?collectionId=lex_3240783567194676000
0_shared&collectionType=Course
Create a text file src.txt and add the following data to it. Mongo, Express, Angular, Node.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_33376440180246
100000_shared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
Implement routing for the AdventureTrails application by embedding the necessary code in
the routes/route.js file.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_29394215542149950000_shared?collectionId=lex_324078356719467600
00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
In myNotes application: (i) we want to handle POST submissions. (ii) display customized
error messages. (iii) perform logging.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_13930661312009580000_shared?collectionId=lex_324078356719467600
00_shared&collectionType=Course
Defaults
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013035588775485440691_shared?collectionId=lex_324078356719
46760000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013035593896869888662_shared?collectionId=lex_324078356719
46760000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013035684270129152696_shared?collectionId=lex_324078356719
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
46760000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_auth_013035745250975744755_shared?collectionId=lex_324078356719
46760000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_24299316914857
090000_shared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_905413034723449100_shared?collectionId=lex_32407835671946760000
_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_31677453061177940000_shared?collectionId=lex_324078356719467600
00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
On the page, display the price of the mobile-based in three different colors. Instead of using
the number in our code, represent them by string values like GoldPlatinum, PinkGold,
SilverTitanium.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_28910354929502245000_shared?collectionId=lex_943623311651267800
0_shared&collectionType=Course
Define an arrow function inside the event handler to filter the product array with the
selected product object using the productId received by the function. Pass the selected
product object to the next screen.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_10783156469383723000_shared?collectionId=lex_943623311651267800
0_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712912427057152901_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
Consider that developer needs to declare a manufacturer's array holding 4 objects with id
and price as a parameter and needs to implement an arrow function - myfunction to
populate the id parameter of manufacturers array whose price is greater than or equ
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712910875500544904_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/handson/lex_auth_01271291494
0641280906_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
Implement business logic for adding multiple Product values into a cart variable which is
type of string array.
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712921860915200909_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
Declare an interface named - Product with two properties like productId and productName
with a number and string datatype and need to implement logic to populate the Product
details.
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712925244276736910_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Declare an interface named - Product with two properties like productId and
productName with the number and string datatype and need to implement logic to
populate the Product details.
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712925995458560912_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712948945346560918_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
Declare a productList interface which extends properties from two other declared
interfaces like Category,Product as well as implementation to create a variable of this
interface type.
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712951652139008920_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
Consider the Mobile Cart application, Create objects of the Product class and place
them into the productlist array.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_3705824317381604400_shared?collectionId=lex_9436233116512678000
_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Declare a class named - Product with the below-mentioned declarations: (i) productId
as number property (ii) Constructor to initialize this value (iii) getProductId method to
return the message "Product id is <<id value>>".
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712954616782848927_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/hands-
on/lex_auth_012712953517170688931_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_9356738095572543000_shared?collectionId=lex_9436233116512678000
_shared&collectionType=Course
Create a namespace called ProductUtility and place the Product class definition in it.
Import the Product class inside productlist file and use it.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_20787271128051925000_shared?collectionId=lex_943623311651267800
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
0_shared&collectionType=Course
Consider the Mobile Cart application which is designed as part of the functions in a
module to calculate the total price of the product using the quantity and price values
and assign it to a totalPrice variable.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_24788158187785620000_shared?collectionId=lex_943623311651267800
0_shared&collectionType=Course
Module Name: What is Generics, What are Type Parameters, Generic Functions,
Generic Constraints
Create a generic array and function to sort numbers as well as string values.
https://infyspringboard.onwingspan.com/web/en/viewer/web-
module/lex_446287045482942800_shared?collectionId=lex_9436233116512678000_
shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content="IEKart's is an online shopping website that sells goods in retail.
This company deals with various categories like Electronics, Clothing, Accessories etc.">
<!-- Other meta tags, stylesheets, and scripts can go here -->
</head>
<body>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
</body>
</html>
1.b.Course Name: HTML5 - The Language Module Name: Sectioning Elements Enhance the
Homepage.html of IEKart's Shopping Application by adding appropriate sectioning elements.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_6372291347110857000_shar
ed?collectionId=lex_1773973283484081000 0_shared&collectionType=Course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
<h1>Welcome to IEKart</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Categories</a></li>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
</ul>
</nav>
<main>
<section>
<h2>Featured Products</h2>
</section>
<section>
<h2>Popular Categories</h2>
</section>
</main>
<footer>
</footer>
</body>
</html>
1.c.Course Name: HTML5 - The Language Module Name: Paragraph Element, Division and Span
Elements, List Element Make use of appropriate grouping elements such as list items to "About Us" page
of IEKart's Shopping Application
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_32785192040894940000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
<!DOCTYPE html>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
<h1>About Us</h1>
</header>
<main>
<section id="company-info">
<h2>Our Company</h2>
</section>
<section id="team-members">
<h2>Our Team</h2>
<ul>
<li>
<div class="team-member">
<h3>John Doe</h3>
<p>Position: CEO</p>
</div>
</li>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
</ul>
</section>
<section id="contact-info">
<h2>Contact Us</h2>
<address>
Phone: 123-456-7890<br>
Email: [email protected]
</address>
</section>
</main>
<footer>
</footer>
</body>
</html>
1.d.Course Name: HTML5 - The Language Module Name: Link Element Link "Login", "SignUp" and
"Trackorder" to "Login.html", "SignUp.html" and "Track.html" page respectively. Bookmark each
category to its details of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_15515105953273338000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<title>IEKart Shopping</title>
</head>
<body>
<nav>
<ul>
<li><a href="Login.html">Login</a></li>
<li><a href="SignUp.html">SignUp</a></li>
</ul>
</nav>
</body>
</html>
1.e.Course Name: HTML5 - The Language Module Name: Character Entities Add the © symbol in the
Home page footer of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_547667376938096260_share
d?collectionId=lex_17739732834840810000 _shared&collectionType=Course
<footer>
</footer>
1.f.Course Name: HTML5 - The Language Module Name: HTML5 Global Attributes Add the global
attributes such as contenteditable, spellcheck, id etc. to enhance the Signup Page functionality of
IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_28723566050321920000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>Signup</h1>
<label for="username">Username:</label>
<br>
<label for="email">Email:</label>
<br>
<label for="password">Password:</label>
<br>
<br>
<br>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<label for="bio">Bio:</label>
<br>
</form>
</body>
</html>
2.a.Course Name: HTML5 - The Language Module Name: Creating Table Elements, Table Elements :
Colspan/Rowspan Attributes, border, cellspacing, cellpadding attributes Enhance the details page of
IEKart's Shopping application by adding a table element to display the available mobile/any inventories.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013168035284033536
113_shared?collectionId=lex_177397328348 40810000_shared&collectionType=Course
<caption>Available Inventories</caption>
<thead>
<tr>
<th>Product</th>
<th>Brand</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Mobile Phone</td>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<td>Brand XYZ</td>
<td>$500</td>
<td>10</td>
</tr>
</tbody>
</table>
2.b.Course Name: HTML5 - The Language Module Name: Creating Form Elements, Color and Date
Pickers, Select and Datalist Elements Using the form elements create Signup page for IEKart's Shopping
application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_13975270903118459000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IEKart Signup</title>
<style>
/* Example styles */
body {
background-color: #f4f4f4;
margin: 0;
padding: 0;
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
form {
max-width: 400px;
background: #fff;
padding: 20px;
border-radius: 5px;
width: 100%;
padding: 10px;
margin: 5px 0;
border-radius: 3px;
box-sizing: border-box;
input[type="submit"] {
width: 100%;
background-color: #4CAF50;
color: white;
margin: 8px 0;
border: none;
border-radius: 4px;
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
cursor: pointer;
input[type="submit"]:hover {
background-color: #45a049;
</style>
</head>
<body>
<label for="email">Email:</label>
<label for="password">Password:</label>
<label for="address">Address:</label>
</form>
</body>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
</html>
2.c.Course Name: HTML5 - The Language Module Name: Input Elements - Attributes Enhance Signup
page functionality of IEKart's Shopping application by adding attributes to input elements.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_14048414537062347000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
2.d.Course Name: HTML5 - The Language Module Name: Media, Iframe Add media content in a frame
using audio, video, iframe elements to the Home page of IEKart's Shopping application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_30738402225794945000_sh
ared?collectionId=lex_177397328348408100 00_shared&collectionType=Course
<audio controls>
</audio>
</video>
3.a.Course Name: Javascript Module Name: Type of Identifiers Write a JavaScript program to find the
area of a circle using radius (var and let - reassign and observe the difference with var and let) and PI
(const)https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_0130532644148
18304732_shared?collectionId=lex_181096983663 32810000_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
// Constants
const PI = 3.14159;
radius = 10;
console.log("Area of the circle with new radius", radius, "using var:", areaVar);
newRadius = 9;
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
console.log("Area of the circle with new radius", newRadius, "using let:", areaLet);
3.b.Course Name: Javascript Module Name: Primitive and Non Primitive Data Types Write JavaScript
code to display the movie details such as movie name, starring, language, and ratings. Initialize the
variables with values of appropriate types. Use template literals wherever necessary.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_21528322245232402000_sh
ared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
// Movie details
let ratings = {
imdb: 8.8,
rottenTomatoes: 87,
metacritic: 74
};
let movieDetails = `
Language: ${language}
Ratings:
- IMDB: ${ratings.imdb}
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
- Metacritic: ${ratings.metacritic}
`;
console.log(movieDetails);
Language: English
Ratings:
- IMDB: 8.8
- Metacritic: 74
3.c.Course Name: Javascript Module Name: Primitive and Non Primitive Data Types Write JavaScript
code to display the movie details such as movie name, starring, language, and ratings. Initialize the
variables with values of appropriate types. Use template literals wherever necessary.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_21528322245232402000_sh
ared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
// Movie details
const ratings = {
imdb: 8.8,
rottenTomatoes: 87,
metacritic: 74
};
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
console.log(`Language: ${language}`);
console.log(`Ratings:`);
Language: English
Ratings:
- IMDb: 8.8
- Metacritic: 74
3.d.Course Name: Javascript Module Name: Operators and Types of Operators Write JavaScript code to
book movie tickets online and calculate the total price, considering the number of tickets and price per
ticket as Rs. 150. Also, apply a festive season discount of 10% and calculate the discounted amount.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_13808338384481720000_sh
ared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
return totalPrice;
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
return discountedAmount;
// Example usage
bookMovieTickets(numTickets, pricePerTicket);
3.e.Course Name: Javascript Module Name: Types of Statements, Non - Conditional Statements, Types
of Conditional Statements, if Statements, switch Statements Write a JavaScript code to book movie
tickets online and calculate the total price based on the 3 conditions: (a) If seats to be booked are not
more than 2, the cost per ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
sehttps://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_16257498471333610000_
shared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
function bookMovieTickets(numSeats) {
if (numSeats <= 0) {
} else {
// Example usage:
Course Name: Javascript Module Name: Types of Loops Write a JavaScript code to book movie tickets
online and calculate the total price based on the 3 conditions: (a) If seats to be booked are not more
than 2, the cost per ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed. (c) If
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_6238536888292970000_shar
ed?collectionId=lex_1810969836633281000 0_shared&collectionType=Course
4.a.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 Write a
JavaScript code to book movie tickets online and calculate the total price based on the 3 conditions: (a)
If seats to be booked are not more than 2, the cost per ticket remains Rs. 150. (b) If seats are 6 or more,
booking is not allowed. (c) If
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_15455199570613326000_sh
ared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
function bookMovieTickets(numSeats) {
let totalPrice = 0;
if (numSeats <= 2) {
return;
} else {
return;
console.log("Total Price for " + numSeats + " seats: Rs. " + totalPrice);
// Example usage:
4.b.Course Name: Javascript Module Name: Working With Classes, Creating and Inheriting Classes
Create an Employee class extending from a base class Person. Hints: (i) Create a class Person with name
and age as attributes. (ii) Add a constructor to initialize the values (iii) Create a class Employee
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
super(name, age);
this.role = role;
// Example usage:
4.c.Course Name: Javascript Module Name: In-built Events and Handlers Write a JavaScript code to book
movie tickets online and calculate the total price based on the 3 conditions: (a) If seats to be booked are
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
not more than 2, the cost per ticket remains Rs. 150. (b) If seats are 6 or more, booking is not allowed.
(c) If se
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_4192188372573027000_shar
ed?collectionId=lex_1810969836633281000 0_shared&collectionType=Course
function bookTickets(seats) {
var totalPrice;
if (seats <= 2) {
return;
} else {
return;
console.log("Total Price for " + seats + " seats: Rs. " + totalPrice);
// Example usage:
4.d.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,
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Document Object Model If a user clicks on the given link, they should see an empty cone, a different
heading, and a different message and a different background color. If user clicks again, they should see a
re-filled cone, a different heading, a different message, and a diffe
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_13197025862804100000_sh
ared?collectionId=lex_181096983663328100 00_shared&collectionType=Course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
.empty {
.filled {
</style>
</head>
<body>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<script>
document.getElementById('changeContentLink').addEventListener('click', function(event) {
if (cone.classList.contains('empty')) {
cone.classList.remove('empty');
cone.classList.add('filled');
} else {
cone.classList.remove('filled');
cone.classList.add('empty');
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
</script>
</body>
</html>
5.a.Course Name: Javascript Module Name: Creating Arrays, Destructuring Arrays, Accessing Arrays,
Array Methods Create an array of objects having movie details. The object should include the movie
name, starring, language, and ratings. Render the details of movies on the page using the array.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013053270191734784
711_shared?collectionId=lex_181096983663 32810000_shared&collectionType=Course
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Movie Details</title>
</head>
<body>
<div id="movieDetails"></div>
<script>
const movies = [
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
language: "English",
ratings: 9.3
},
language: "English",
ratings: 9.2
},
language: "English",
ratings: 9.0
];
function renderMovieDetails() {
movies.forEach(movie => {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
movieElement.innerHTML = `
<h2>${movie.name}</h2>
<p><strong>Starring:</strong> ${movie.starring}</p>
<p><strong>Language:</strong> ${movie.language}</p>
<p><strong>Ratings:</strong> ${movie.ratings}</p>
<hr>
`;
movieDetailsContainer.appendChild(movieElement);
});
renderMovieDetails();
</script>
</body>
</html>
function generateRandomStockPrice() {
const randomChange = (Math.random() * 20) - 10; // Adjust range according to your preference
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
function displayStockPrice() {
// Replace
'https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_012599811633905664
460_shared?collectionId=lex_18109698366332810000_shared&collectionType=Course' with your URL
if (window.location.href ===
'https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_012599811633905664
460_shared?collectionId=lex_18109698366332810000_shared&collectionType=Course') {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
clearInterval(intervalId);
5.c.Course Name: Javascript Module Name: Creating Modules, Consuming Modules Validate the user by
creating a login module. Hints: (i) Create a file login.js with a User class. (ii) Create a validate method
with username and password as arguments. (iii) If the username and password are equal it will return
"Login Successful" else w
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013052857053585408
667_shared?collectionId=lex_181096983663 32810000_shared&collectionType=Course
// login.js
class User {
constructor(username, password) {
this.username = username;
this.password = password;
validate(inputUsername, inputPassword) {
} else {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
// app.js
6.a.Course Name: Node.js Module Name: How to use Node.js Verify how to execute different functions
successfully in the Node.js platform.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_19002830632103186000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
// functions.js
function greet(name) {
function add(a, b) {
return a + b;
module.exports = {
greet,
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
add
};
// index.js
6.b.Course Name: Node.js Module Name: Create a web server in Node.js Write a program to show the
workflow of JavaScript code executable by creating web server in Node.js.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_28177338996267815000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
// Set the response HTTP header with HTTP status and Content type
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
6.c.Course Name: Node.js Module Name: Modular programming in Node.js Write a Node.js module to
show the workflow of Modularization of Node application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_28865394191004004000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
mkdir nodejs-modular-example
cd nodejs-modular-example
npm init –y
3. Create a main.js file, which will be the entry point of your application:
// main.js
greet('John');
// greetings.js
function greet(name) {
console.log(Hello, ${name}!);
node main.js
6.d.Course Name: Node.js Module Name: Restarting Node Application Write a program to show the
workflow of restarting a Node application.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_9174073856000159000_shar
ed?collectionId=lex_3240783567194676000 0_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
nodemon your_app.js
const fs = require('fs');
console.log('Restarting application...');
detached: true,
stdio: 'inherit'
});
child.unref();
process.exit();
};
watchFiles.forEach(file => {
restartApp();
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
});
6.e.Course Name: Node.js Module Name: File Operations Create a text file src.txt and add the following
data to it. Mongo, Express, Angular, Node.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_33376440180246100000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
const fs = require('fs');
// File path
if (err) {
} else {
});
7.a.Course Name: Express.js Module Name: Defining a route, Handling Routes, Route Parameters,
QueryParameters Implement routing for the AdventureTrails application by embedding the necessary
code in
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
1. Defining Routes: Start by requiring Express and creating an instance of the Router:
2. Handling Routes: Define route handlers for different endpoints. For example:
res.send('Welcome to AdventureTrails!');
});
});
});
4. Query Parameters: Access query parameters from the request object. For example:
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
5. Export the Router: Finally, export the router so it can be used by the main application
file:module.exports = router;
In your main application file (e.g., app.js), you would then require the routes.js file and use the
router:const express = require('express');
app.use('/', routes);
app.listen(PORT, () => {
});
7.b.Course Name: Express.js Module Name: How Middleware works, Chaining of Middlewares, Types of
Middlewares In myNotes application: (i) we want to handle POST submissions. (ii) display customized
error messages. (iii) perform logging.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_13930661312009580000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
next();
});
console.error(err.stack);
res.status(500).send('Something broke!');
});
});
app.listen(PORT, () => {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
7.c.Course Name: Express.js Module Name: Connecting to MongoDB with Mongoose, Validation Types
and Defaults Write a Mongoose schema to connect with MongoDB.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013035588775485440
691_shared?collectionId=lex_324078356719 46760000_shared&collectionType=Course const
mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/your-database-name', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
username: {
type: String,
required: true,
unique: true,
minlength: 3,
maxlength: 20,
},
email: {
type: String,
required: true,
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
unique: true,
match: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
},
age: {
type: Number,
default: 18,
min: 18,
},
createdAt: {
type: Date,
default: Date.now,
},
});
module.exports = User; // Export the model for use in other parts of your application
7.d.Course Name: Express.js Module Name: Models Write a program to wrap the Schema into a Model
object.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013035593896869888
662_shared?collectionId=lex_324078356719 46760000_shared&collectionType=Course
name: String,
email: String,
age: Number
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
// Example usage:
email: '[email protected]',
age: 30
});
newUser.save()
.then(() => {
})
.catch((err) => {
});
8.a.Course Name: Express.js Module Name: CRUD Operations Write a program to perform various CRUD
(Create-Read-Update-Delete) operations using Mongoose library functions.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013035684270129152
696_shared?collectionId=lex_324078356719 46760000_shared&collectionType=Course
// Setting up Express.js
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
app.use(express.json());
mongoose.connect('mongodb://localhost:27017/my_database', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
name: String,
age: Number,
});
// CRUD operations
// Create operation
try {
await user.save();
res.status(201).send(user);
} catch (error) {
res.status(400).send(error);
});
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
try {
res.send(users);
} catch (error) {
res.status(500).send(error);
});
try {
if (!user) {
return res.status(404).send();
res.send(user);
} catch (error) {
res.status(500).send(error);
});
// Update operation
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
allowedUpdates.includes(update)
);
if (!isValidOperation) {
try {
new: true,
runValidators: true,
});
if (!user) {
return res.status(404).send();
res.send(user);
} catch (error) {
res.status(400).send(error);
});
// Delete operation
try {
if (!user) {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
return res.status(404).send();
res.send(user);
} catch (error) {
res.status(500).send(error);
});
app.listen(PORT, () => {
});
8.b.Course Name: Express.js Module Name: API Development In the myNotes application, include APIs
based on the requirements provided. (i) API should fetch the details of the notes based on a notesID
which is provided in the URL. Test URL - http://localhost:3000/notes/7555 (ii) API should update the
details bas
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_auth_013035745250975744
755_shared?collectionId=lex_324078356719 46760000_shared&collectionType=Course
// Sample data for notes (you'll replace this with your actual data source)
let notes = [
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
];
app.use(bodyParser.json());
if (!note) {
res.json(note);
});
});
app.listen(port, () => {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
});
8.c.Course Name: Express.js Module Name: Why Session management, Cookies Write a program to
explain session management using cookies.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_24299316914857090000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
app.use(cookieParser());
if (!req.cookies.session) {
res.cookie('session', { visits: 1 }, { maxAge: 900000, httpOnly: true }); // maxAge is in milliseconds (15
minutes)
req.visits = 1;
} else {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
session.visits++;
req.visits = session.visits;
next();
});
});
app.listen(PORT, () => {
});
8.d.Course Name: Express.js Module Name: Sessions Write a program to explain session management
using sessions.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_905413034723449100_share
d?collectionId=lex_32407835671946760000 _shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
app.use(session({
resave: false,
saveUninitialized: true
}));
// Routes
if (req.session.views) {
req.session.views++;
} else {
req.session.views = 1;
});
// Start server
app.listen(PORT, () => {
});
8.e.Course Name: Express.js Module Name: Why and What Security, Helmet Middleware Implement
security features in myNotes application
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_31677453061177940000_sh
ared?collectionId=lex_324078356719467600 00_shared&collectionType=Course
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
Understand Security Risks: Before implementing security features, it's crucial to understand common security risks in
web applications. This module likely covers topics such as cross-site scripting (XSS), cross-site request forgery (CSRF),
HTTP headers, and other vulnerabilities.
Install Helmet Middleware: Helmet is a collection of middleware functions for securing Express.js applications by
setting various HTTP headers. Install it using npm:
Integrate Helmet Middleware: In your Express.js application, integrate Helmet middleware by requiring it and using
it as follows:
app.use(helmet());
Customize Helmet Middleware: Helmet provides various middleware functions to set specific HTTP headers for
different security purposes. You can customize which headers you want to set based on your application's
requirements. For example:
app.use(helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'"],
}));
9.a.Course Name: Typescript Module Name: Basics of TypeScript On the page, display the price of the
mobile- based in three different colors. Instead of using the number in our code, represent them by
string valueslike GoldPlatinum, PinkGold, SilverTitanium.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_28910354929502245000_sh
ared?collectionId=lex_943623311651267800 0_shared&collectionType=Course
<!DOCTYPE html>
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mobile Prices</title>
<style>
</style>
</head>
<body>
<h1>Mobile Prices</h1>
<script>
// Display prices
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
</script>
</body>
</html>
9.b.Course Name: Typescript Module Name: Function Define an arrow function inside the event handler
to filter the product array with the selected product object using the productId received by the function.
Pass the selected product object to the next screen.
https://infyspringboard.onwingspan.com/web/en/viewer/webmodule/lex_10783156469383723000_sh
ared?collectionId=lex_943623311651267800 0_shared&collectionType=Course
// Assuming you have a product array and a function to navigate to the next screen
const products: Product[] = [...]; // Assuming Product is a type representing your product object
navigateToNextScreen(selectedProduct);
};
navigateToNextScreen(selectedProduct);
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
};
filterProductAndNavigate();
};
9.c.Course Name: Typescript Module Name: Parameter Types and Return Types Consider that developer
needs to declare a function - getMobileByVendor which accepts string as input parameter and returns
the list of mobiles.
https://infyspringboard.onwingspan.com/web/en/viewer/handson/lex_auth_012712912427057152901
_shared?collectionId=lex_9436233116512678 000_shared&collectionType=Course
type Mobile = {
name: string;
vendor: string;
};
// Assuming there is a list of mobiles somewhere, you can filter them based on the vendor
];
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
return filteredMobiles;
// Example usage
console.log(mobilesByVendor); // This will log an array of Mobile objects with vendor "VendorA"
9.d.Course Name: Typescript Module Name: Arrow Function Consider that developer needs to declare a
manufacturer's array holding 4 objects with id and price as a parameter and needs to implement an
arrow function - myfunction to populate the id parameter of manufacturers array whose price is greater
than or equ
https://infyspringboard.onwingspan.com/web/en/viewer/handson/lex_auth_012712910875500544904
_shared?collectionId=lex_9436233116512678 000_shared&collectionType=Course
];
// Define the arrow function to filter manufacturers based on price and populate the id parameter
const myFunction = (manufacturers: { id: number, price: number }[], priceThreshold: number): number[]
=> {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
// Usage example:
console.log("Manufacturer IDs with price greater than or equal to", priceThreshold, ":", resultIds);
9.e Course Name: Typescript Module Name: Optional and Default Parameters Declare a function -
getMobileByManufacturer with two parameters namely manufacturer and id, where manufacturer value
should passed as Samsung and id parameter should be optional while invoking the function, if id is passed
as 101 then this function shoul https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712914940641280906_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
10.a Course Name: Typescript Module Name: Rest Parameter Implement business logic for adding
multiple Product values into a cart variable which is type of string array.
https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712921860915200909_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
10.b Course Name: Typescript Module Name: Creating an Interface Declare an interface named - Product
with two properties like productId and productName with a number and string datatype and need to
implement logic to populate the Product details.
https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712925244276736910_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
interface Product {
productId: number;
productName: string;
}
10.c Course Name: Typescript Module Name: Duck Typing Declare an interface named - Product with two
properties like productId and productName with the number and string datatype and need to implement
logic to populate the Product details. https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712925995458560912_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
10.d Course Name: Typescript Module Name: Function Types Declare an interface with function type and
access its value. https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712948945346560918_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
11.a Course Name: Typescript Module Name: Extending Interfaces Declare a productList interface which
extends properties from two other declared interfaces like Category,Product as well as implementation to
create a variable of this interface type. https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712951652139008920_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
// Example usage
console.log(myProduct);
11.b Course Name: Typescript Module Name: Classes Consider the Mobile Cart application, Create objects
of the Product class and place them into the productlist array.
https://infyspringboard.onwingspan.com/web/en/viewer/web
module/lex_3705824317381604400_shared?collectionId=lex_9436233116512678000
_shared&collectionType=Course
class Product {
constructor(public name: string, public price: number) {}
}
11.c Course Name: Typescript Module Name: Constructor Declare a class named - Product with the below-
mentioned declarations: (i) productId as number property (ii) Constructor to initialize this value (iii)
getProductId method to return the message "Product id is <>".
https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712954616782848927_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
class Product {
private productId: number;
constructor(productId: number) {
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
this.productId = productId;
}
getProductId(): string {
return `Product id is ${this.productId}`;
}
}
// Example usage:
const product = new Product(1001);
console.log(product.getProductId()); // Output: Product id is 1001
11.d Course Name: Typescript Module Name: Access Modifiers Create a Product class with 4 properties
namely productId, productName, productPrice, productCategory with private, public, static, and
protected access modifiers and accessing them through Gadget class and its methods.
https://infyspringboard.onwingspan.com/web/en/viewer/hands
on/lex_auth_012712953517170688931_shared?collectionId=lex_9436233116512678
000_shared&collectionType=Course
class Product {
private productId: number;
public productName: string;
static productPrice: number;
protected productCategory: string;
display(): void {
console.log(`Product ID: ${this.productId}`);
console.log(`Product Name: ${this.productName}`);
console.log(`Product Price: ${Product.productPrice}`);
console.log(`Product Category: ${this.productCategory}`);
}
}
class Gadget {
static displayProductDetails(product: Product): void {
// Accessing public property
console.log(`Product Name: ${product.productName}`);
// Accessing static property
console.log(`Product Price: ${Product.productPrice}`);
// Accessing protected property indirectly
console.log(`Product Category: ${product['productCategory']}`);
// Accessing private property indirectly
console.log(`Product ID: ${product['productId']}`);
}
PITM Dept.CSE
MEAN STACK TECHNOLOGIES-MODULE I- HTML 5, JAVASCRIPT, NODE.JS,EXPRESS.JS, AND TYPESCRIPT
// Usage
Product.productPrice = 100; // Assigning value to static property
const product1 = new Product(1, 'Laptop', 'Electronics');
Gadget.displayProductDetails(product1);
12.a Course Name: Typescript Module Name: Properties and Methods Create a Product class with 4
properties namely productId and methods to setProductId() and getProductId().
https://infyspringboard.onwingspan.com/web/en/viewer/web
module/lex_9356738095572543000_shared?collectionId=lex_9436233116512678000
_shared&collectionType=Course
class Product {
private productId: string;
constructor(productId: string) {
this.productId = productId;
}
// Example usage
const product = new Product("ABC123");
console.log(product.getProductId()); // Output: ABC123
product.setProductId("XYZ789");
console.log(product.getProductId()); // Output: XYZ789
12.b Course Name: Typescript Module Name: Creating and using Namespaces Create a namespace called
ProductUtility and place the Product class definition in it. Import the Product class inside productlist file
and use it. https://infyspringboard.onwingspan.com/web/en/viewer/web
module/lex_20787271128051925000_shared?collectionId=lex_943623311651267800
0_shared&collectionType=Course
}
}
}
12.c Course Name: Typescript Module Name: Creating and using Modules Consider the Mobile Cart
application which is designed as part of the functions in a module to calculate the total price of the
product using the quantity and price values and assign it to a totalPrice variable.
https://infyspringboard.onwingspan.com/web/en/viewer/web
module/lex_24788158187785620000_shared?collectionId=lex_943623311651267800
0_shared&collectionType=Course
// mobileCart.ts
export interface Product {
quantity: number;
price: number;
}
// main.ts
import { Product, calculateTotalPrice } from './mobileCart';
12.d Course Name: Typescript Module Name: What is Generics, What are Type Parameters, Generic
Functions, Generic Constraints Create a generic array and function to sort numbers as well as string
values. https://infyspringboard.onwingspan.com/web/en/viewer/web
module/lex_446287045482942800_shared?collectionId=lex_9436233116512678000_
shared&collectionType=Course
PITM Dept.CSE