E Journal WD
E Journal WD
B.VOC (ST)
STS-201 - WEB DEVELOPER
LAB JOURNAL
2023-2024
Name: Glyde
Rebelo Roll No:
2320714
Class: FY BVoc(ST)
Semester: II
Submission Date : 31-03-2024
INDEX
Sr. Pag
Topic e
No.
No.
JavaScript:
3 Arrow function, Do while, for loop, if else, switch, while and 27 - 38
This function
JavaScript: 39 - 44
4
2d Array, Array, Find maximum and Object
JavaScript:
5 Double click function, Form validation using required attribute, 45 - 57
Form validation(manually), Keyboard event and on mouse over
event
JavaScript:
6 58 - 64
Error handling, Math function, String function
Introduction to bootstrap:
7 65 - 68
Creating a home page of jewellery shop using bootstrap
Java:
9 Generate random number, Prime Number, Fibonacci series, 86 - 90
Palindrome, Factorial of number
Java:
10 Reverse a number, Program to display Even numbers from 1 to 91 - 94
100, Find sum of natural numbers, Find largest of three numbers,
Sort an Array
Code:
college.html
<!DOCTYPE html>
<html>
<head>
<style
>
table
width:
100%;
height:
40px;
border-collapse:
collapse;
footer {
text-align: center;
background-color:
footer img {
width: 50px;
height:
50px;
}
</style>
</head>
<body>
<header>
<table>
<tr>
</td>
<td>
</td>
<td style="width:25%"></td>
</tr>
</table>
</header>
<hr>
<table>
<p>Student details</p>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Age</th>
</tr>
<tr style="background-color: aquamarine;">
<td>Adley</td>
<td>Fernandes</td>
<td>43</td>
</td>
</tr>
<tr>
<td>Ronisha</td>
<td>Barreto</td>
<td>23</td>
</td>
</tr>
<td>Bivin</td>
<td>Roy</td>
<td>17</td>
</td>
</tr>
<tr>
<td>Lynsey</td>
<td>Fernandes</td>
<td>37</td>
</tr>
</table>
<footer>
<p>Follow us on</p>
<img src="facebook.jpg">
<img src="twitter.jpeg">
<img src="link.jpg">
<img src="insta.jpg">
</footer>
</body>
</html>
Detailiframe.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Established in 1973, Vidya Vikas Mandal’s Shree Damodar College of Commerce &
Economics – the flagship
College has UGC recognition and is permanently affiliated to Goa University. </p>
</body>
</html>
Output :
college.html
Detailiframe.html
Expt No 2:
Aim : Website using HTML and CSS
Theory: A makeup website using HTML and CSS. HTML is like the skeleton of our
website, providing the structure with different parts like the header, navigation
menu, sections for content, and footer. With the help of CSS, we can make our
website look good. It helps us to add colors, styles, and layouts to our HTML
elements. By keeping our CSS in separate files, we can make changes more easily
and keep our code organized.
Code:
Makeup.css
body {
background-color: #F0EBF4; }
#heading{
text-
align:center;
font-size: 50px ;
padding-bottom: 10px;
background-color:
#B8DAD9; width:400px;
nav {
height:30px;
padding-bottom: 10px;
padding-top: 10px;
background-
color:#C0B9BF; text-
align:left;
a:hover {
background-color: #B8DAD9; }
a{
text-align: left;
padding-left:
10px; color:black;
text-decoration:
none; margin-left:
10px;
font-size: 20px;
padding-right:
10px;
.container img {
width:1000px;
height:100%;
margin-left: 250px;
h1 {
font-family:
Nevis;
margin:10px;
p{
font-size:20px; }
h2 {
margin:20px;
table{
width: 100%; }
td{
align:left;
padding:
10px; font-
size:20px;
height:200px;
td p{
font-size: 20px; }
td h2{
color:rgb(81, 4, 4); }
td img {
width:400px; }
h1
{
text-align: center;
.product {
margin:30p
x;
border:1px solid
black; border-radius:
5px; float:left;
width:300px;
height:550px;
margin:20px;
padding: 15px;
}
.product img {
width:auto;
height:300px;
.price {
color:green;
font-weight: bold; }
.description {
margin-top: 10px;
} button {
width:100px;
height:50px;
padding: 10px;
margin-top:
10px;
background-color:
#4caf50; color:white;
border: none;
border-radius:
5px;
}
button:hover {
background-color: #45a049; }
input[type="text"],
input[type=passwor
d],
input[type="email"],
input[type="tel"]{
width:100%;
padding:12px
20px;
margin:8px 0;
border:1px solid
#ccc; border-
radius:4px; box-
sizing:border-box;
.form {
border-radius:5px;
background-color:
#f2f2f2; padding:50px;
width:400px;
text-align:left;
font-size:20px; }
input[type=submit] {
width:100%;
background-
color:green;
color:white;
padding:14px 20px;
margin:8px 0;
border:none;
border-
radius:4px;
cursor:pointer;
font-size:20px;
input[type=submit]:hover {
background-
color:#45a049; }
input[type=radio],
input[type=checkbox
]{
width: 15px;
height: 15px;
label {
font-size: 20px;
textarea {
width:400px;
height:200px;
button:hover {
background-color: #45a049; }
home.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<center>
</center>
<nav>
<a href="home.html">Home</a>
<a href="makeup.html">Makeup</a>
<a href="skincare.html">Our Product</a>
</nav>
<div class="container">
</div>
<div id="makeup">
<p>We have come in with our guide that gives you the steps to apply makeup.
Before we give you the 4-1-1 on steps to apply makeup, we want to let you know
there really is no set-in-stone correct order. When it comes to following makeup
steps in order, you want to remember that you should do what works best for your
skill level, your skin, and the overall look you are going for.<br><br>
We hope this guide helps you to feel more confident in your own skin and
gets you one step closer to the makeup look you are going for. So, keep reading to
learn more about our step-by-step makeup guide and get to creating a makeup
masterpiece.<br><br>
</div>
</body>
</html>
Output:
Makeup.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Makeup and skincare </title>
</head>
<body>
<nav>
<a href="home.html">Home</a>
<a href="makeup.html">Makeup</a>
</nav>
<table>
<tr>
<td>
<h2>STEP 1: MOISTURIZER</h2>
<p>Make sure to complete your skin care routine before reaching for any
makeup tools. Prep your skin with a moisturizer or serum to create a good base.
This will keep your skin hydrated and firm and help lay your makeup properly. If
your skin is not moisturized enough, the foundation will look cakey and heavy and
is deposited on the dry areas of your face.</p>
</td>
<td><img src="images/moisturizer.webp"></td>
</tr>
<tr>
<td>
<h2>STEP 2: PRIMER</h2>
<p>Now that your skin is well moisturized, prep your face with primer. Whether
you’re planning on applying a light coat of foundation or a full face of makeup,
primer is an important first step Using primer under your makeup will make your
look last longer.</p>
</td>
<td><img src="images/primer.jpg"></td>
</tr>
<tr>
<td>
<h2>STEP 3: FOUNDATION</h2>
</td>
<td><img src="images/foundation.jpg"></td>
</tr>
<tr>
<td>
<h2>STEP 4: CONCEALER</h2>
<p>Concealer is amazing to make you look more awake and get rid of
shadow, dark areas. Pick a product that is two shades lighter than your foundation or
natural skin tone.
Liquid concealer is best for the times you want light coverage over a large area of
your face. Liquid concealer also works well for those looking to create a light finish,
especially in areas of wrinkles, like around the eyes and mouth. </p>
</td>
<td><img src="images/concealer.webp"></td>
</tr>
<tr>
<td>
<p>Set your makeup base with loose, compact, or setting powder. But
remember, when it comes to powder,less is more. Using a large, fluffy powder brush,
begin by dusting a
light coat of powder all over your face. Press the bristles into the powder, then sweep
across the skin in long, arching strokes.
</p>
</td>
<td><img src="images/powder.webp"></td>
</tr>
<tr>
<td>
<h2>STEP 6: BRONZER</h2>
<p>Bronzer can give your skin that sun-kissed glow all year long. Use a
dedicated bronzer brush to sweep a golden tan across your face bronzer brushes are
crafted with more bristles, and placed much more tightly together, ensuring you get
the most out of your colorful bronzer with each and every swipe.
</p>
</td>
<td><img src="images/bronzer.webp"></td>
</tr>
<tr>
<td>
<h2>STEP 7: BLUSH</h2>
</td>
<td><img src="images/blush.webp"></td>
</tr>
<tr>
<td>
<h2>STEP 8: HIGHLIGHTER</h2>
<p>The right highlighter adds a bit of glam and glow to every makeup look.
Whether you’re opting for a more natural look or want something bold and beautiful,
highlighter can complement your makeup application. Highlighters come in a
variety of forms, including liquids, creams, and powders. You can choose to use
one, or find your favorite combination of two or three. </p>
</td>
<td><img src="images/highlighter.webp"></td>
</tr>
<tr>
<td>
<h2>Step 9: EYEBROWS</h2>
<p>You can use brow liner or eyebrow pencil or gel to shade or fill in your
eyebrows. Unless you have blonde hair, use a product two or three shades lighter
than your hair color. Follow the natural curve of your brows and create a well-
defined arch with an eyebrow brush </p>
</td>
<td><img src="images/eyebrow.jpg"></td>
</tr>
<tr>
<td>
<p>Eyeshadow can add interest to your makeup look, whether you opt for
neutral shades or go bold with colorful hues. Whichever look you use, grab two
complementary eyeshadows: one lighter shade, and one darker shade.</p>
</td>
<td><img src="images/eyeshadow.webp"></td>
</tr>
<tr>
<td>
<p> Applying eyeliner can be difficult—one little mistake and you’re stuck
with “raccoon” eyes. Banish your eye makeup woes with these essential tips for
applying eyeliner. Apply eyeliner before mascara and after applying eyeshadow
or doing your eyebrows. Use waterproof eyeliner and use it in your waterline for
added definition. You can choose a gel, liquid, or pencil eyeliner.</p>
</td>
</tr>
<tr>
<td>
<p>Make your lashes fuller, thicker, and longer with mascara. Try to use a
lightweight or air-whipped formula so that your lashes do not feel weighed down.
Also, do not skip on eyelash curler before applying mascara if you want to hold
your curl.</p>
</td>
</tr>
<tr>
<td>
<p>Outline your lips with a lip liner and select a lipstick of your choice.
Match the color of your liner with your lipstick shade. If you want to create fuller lips
and a larger pout, make the line over your lips </p>
</td>
<td><img src="images/lipstick.jpg"></td>
</tr>
<tr>
<td>
<p>Setting spray or setting powder can be the final touch for your makeup routine.
If you want makeup that stays on all day long, without greasing, creasing, or
shine, it’s important to invest in a quality setting solution. Setting sprays are
designed for all skin types, and can be used to set a variety of looks, whether
you’re rocking light coverage or sporting a full face of beautiful makeup.</p>
</td>
</tr>
</table>
</body>
</html>
Output :
Skincare.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<nav>
<a href="home.html">Home</a>
<a href="makeup.html">Makeup</a>
<a href="skincare.html">Our Product</a>
<a href="contact us.html">Contact Us</a>
</nav>
<div class="product">
<img src="images/product1.webp">
<p class="price">₹229</p>
</div>
<div class="product">
<img src="images/product3.jpg">
</div>
<div class="product">
<img src="images/product5.jpg">
</div>
<div class="product">
<img src="images/product7.jpg">
<p class="description">Swiss Beauty Liquid Light Weight Concealer With Full Coverage
|Easily Blendable Concealer For Face Makeup | Sand Sable, 6G</p>
<p class="price">₹169</p>
</div>
<div class="product">
<img src="images/product9.jpg">
</div>
<div class="product">
<img src="images/product11.jpg">
<p class="price">₹743</p>
</div>
<div class="product">
<img src="images/product13.jpg">
</div>
<div class="product">
<img src="images/product15.jpg">
<p class="price">₹303</p>
</div>
</body>
</html>
Output:
Contact us.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<nav>
<a href="home.html">Home</a>
<a href="makeup.html">Makeup</a>
</nav>
<form>
<center>
<div class="form">
<center><h2>Login in</h2></center>
<label for="Uname">Username:</label>
<label for="pass">Password:</label>
<label for="Male">Male</label>
<option value="bestsellers">Bestsellers</option>
</select><br><br>
<textarea id="comment" name="comment" placeholder="what you would
like to suggest"></textarea><br><br>
</div>
</center>
</form>
</body>
</html>
Output:
Expt No 3: JavaScript
Aim : Learn about Arrow function, Conditional statements like- while, do while, for ,
switch, if else and this function.
a) Arrow
Function
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML= myfunction(12,2);
</script>
</body>
</html>
Output:
b) Dowhil
e Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
i=2;
console.log('Fibonanci');
console.log(num1);
console.log(num2);
nextTerm= num1 +
num2; do {
console.log(nextTer
m) num1 = num2;
num2 = nextTerm;
nextTerm= num1 +
num2; i++;
while(i<number)
</script>
</body>
</html>
Output:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button onclick="calculate()">Calculate</button>
<h1 id="ans"></h1>
<script>
function calculate() {
number=document.getElementById('val').valu
e; let sum=0;
for(i=1;i<=number;i++)
{ sum +=i;
</script>
</body>
</html>
Output:
d) JS If
else
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
function calculate() {
marks=document.getElementById('marksobtained').value
; total=document.getElementById('totalmarks').value;
percentage=marks*100/total;
document.getElementById('percent').value=percentage;
if(percentage<35){
classobtained="Fail
";
}
else if(percentage<40){
classobtained="Pass
class";
}
else if(percentage<60){
classobtained="Second class";
else if (percentage<75) {
classobtained="First
class";
else {
classobtained="Distinction";
document.getElementById('class').innerHTML=classobtained; }
</script>
<table>
<tr>
<td><label>Marks obtained</label></td>
</tr>
<tr>
<td><label>Total marks</label></td>
</tr>
<tr>
</tr>
<tr>
<td><label>Percentage</label></td>
</tr>
<tr>
<td> <p id="class"></p>
</td>
</tr>
</body>
</html>
output:
e) JS
Switch
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
function calculate(){
num1 =document.getElementById('val1').value;
num2 =document.getElementById('val2').value;
const
expr=document.getElementById('opt').value;
switch(expr){
case '+':
document.getElementById("ans").value = parseInt(num1)+parseInt(num2);
break;
case'-':
document.getElementById("ans").value = parseInt(num1)-parseInt(num2);
break;
case '*':
document.getElementById("ans").value = parseInt(num1)*parseInt(num2);
break;
case '/':
if(num2==0
){
else{
document.getElementById("ans").value = parseInt(num1)/parseInt(num2)
break
; case
'%':
if(num2==0){
alert("enter
value2")
else{
document.getElementById("ans").value = parseInt(num1)%parseInt(num2);
break;
}
}
</script>
<table>
<tr>
<td><label>Number 1:</label></td>
</tr>
<tr>
<td>
<select id="opt">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
<option value="%">%</option>
</select>
</td>
</tr>
<tr>
<td><label>Number 2:</label></td>
</tr>
<tr>
<td><button onclick="calculate()">Calculate</button></td>
</tr>
<tr>
<td><label>Answer = </label></td>
</tr>
</body>
</html>
Output:
f) JS
While
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2 id="demo"></h2>
<script>
);
let i=1;
var temp="";
while(i<=10) {
+result+"<br>"; i++;
}
document.getElementById("demo").innerHTML=temp;
</script>
</body>
</html>
Output:
g) This
function
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>This keyword</h1>
<p id="demo"></p>
<script>
const person ={
firstName: "Aarti",
lastName:"Solanki"
, id:5432,
fullName: function(){
};
document.getElementById('demo').innerHTML=person.fullName();
</script>
</body>
</html>
Output:
Expt No 4:
Aim : Learn about 2D array , Arrays , Finding largest using if else statement and object
Theory: An array is a special variable, which can hold more than one value of same
data type. There are two types of array : 1D array this is a simple list of elements
stored together under one variable name. Each element can be accessed by its index
and 2D array this is an array of arrays, forming a matrix-like structure. Each element
of a 2D array is itself an array, so you have rows and columns. You can access
elements using two index, one for the row and one for the column. To find largest of
3 nos we have used 2 methods first using if else inside a function and second using
math function that is Math.max. Objects in JavaScript are collections of key-value
pairs, where each key is a unique identifier and each value can be of any data type.
a) 2d
array
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>2D Arrays</h2>
<p id="demo"></p>
<script>
let numberArr
= [ [10,20,30],
[40,50,60],
[70,80,90],
[100,110,120],
[130,140,150]
];
var sum = 0;
numberArr.forEach ((row)
=> {
row.forEach ((element)
});
</script>
</body>
</html>
Output:
b) Arr
1
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo"></p>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
<p id="demo4"></p>
<p id="demo5"></p>
<script>
const color =
["Blue","Orange","Red","Yellow","Pink"]; size=
color.length;
:</b>"+size;
document.getElementById("demo1").innerHTML="<b>Array :</b>"+color;
color.sort();
document.getElementById("demo2").innerHTML="<b>Sorted Array:
</b>"+color; color.reverse();
document.getElementById("demo3").innerHTML="<b>Reversed Array:</b>
document.getElementById("demo5").innerHTML= color.join("*");
</script>
</body>
</html>
Output:
c) Maxn
o
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo"></p>
<p id="demo1"></p>
<script>
return num1;
{ return num2;
} else {
return num3;
function
findmax(num1,num2,num3) {
return
Math.max(num1,num2,num3);
}
</script>
</body>
</html>
Output:
d) Objec
t
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>Javascript objects</h2>
<p id="demo"></p>
<p id="demo1"></p>
<script>
color:"white", engine:"V12"};
document.getElementById("demo").innerHTML=
car.Name + " color is " + car.color + " in the year " + car.model + " and engine is "
+car.engin
e;
</script>
</body>
</html>
Output:
Expt No 5:
Aim : Learn about double click function, form validation using two different ways- By
using required attribute in the form inputs and by writing conditional statements ,
keyboard event and mouse over event.
Theory: In JavaScript, the double click function is an event that occurs when a user
clicks a mouse button twice. In Form validation to ensure that user input has to be
correct we can check in two ways one way is by using the required attribute in form
inputs. This attribute tells that input field must be filled out before the form is
submitted. Second way is by writing conditional statements in JS . You can use these
statements to check the values entered by the user against predefined rules or
patterns, displaying error messages if the input is invalid. Keyboard events allow
JavaScript code to respond to user interactions with the keyboard. Mouseover
events occur when the user moves the mouse cursor over an element on a web
page.
a) Double
click Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo"></p>
<script>
function myFunction(){
</script>
</body>
</html>
Output:
b) Form
val
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>Form Validation</h2>
<br><br>
<label>Phone no:</label>
<br><br>
<label>Email Id: </label> <input type="email" name="email" required>
<br><br>
<br><br>
</form>
</body>
</html>
Output:
c) Form val
2 Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
function validateForm(){
// name validation
let x = document.forms["myForm"]
// Email validation
var y =
document.myForm.email.value; var
atpos = y.indexOf("@");
{
alert("Not a valid e-mail
// phone validation
let p =
document.getElementById("phone").value;
if(isNaN(p) || p.length!==10){
alert("Invalid Phone
// checkbox
if((document.getElementById("male").checked ==
false) && (document.getElementById("female").checked
== false))
alert("Please select a
</script>
</head>
<body>
<h2><center>REGISTRATION FORM</center></h2>
<label for="fname">Name</label>
<br><br>
<label for="email">Email</label>
<br><br>
<br><br>
<label for="age">Age</label>
<br><br>
<label for="country">Country</label>
<br><br>
<label for="password">Password</label>
<br><br>
<Label for="file">Resume</Label>
<br><br>
<label>Hobbies</label>
<label for="cricket">Cricket</label>
<label for="football">Football</label>
<br><br>
<label>Gender</label>
<label for="Male">Male</label>
<label for="Female">Female</label>
<br><br>
<label for="city">City:</label>
<option value="mumbai">Mumbai</option>
<option value="Delhi">Delhi</option>
<option value="Kolkata">Kolkata</option>
<option value="Pune">Pune</option>
</optgroup>
<option value="chennai">Chennai</option>
<option value="bangalore">Bangalore</option>
<option value="surat">Surat</option>
<option value="jaipur">Jaipur</option>
</optgroup>
</select>
<br><br>
<label>Address:</label><br>
<br><br>
<button>Submit</button>
<button>Reset</button>
</form>
</body>
</html>
Output:
d) Keyboard
event Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Javascript</h1>
<p>A function is triggered when the user is pressing a key in the input field.</p>
<script>
function myFunction() {
</script>
</body>
</html>
Output:
e) On mouse
over Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
function over()
document.getElementById('Key').style.color="blue";
function out()
document.getElementById('Key').style.color="red";
}
</script>
</body>
</html>
Output:
Expt No 6:
Aim : Learn about Error handling, Math function, and string function.
Theory: Error handling is about handle errors that occur during the execution of the
code. In JS error handling can be done with try...catch blocks . With try, you wrap
the code that might cause an error, and with catch, you define what to do if an
error occurs. Math functions in JS provide a variety of mathematical operations that
you can perform on numbers functions like Math.max() to find the highest number,
Math.min() to find the lowest number, Math.round() to round a number to the
nearest integer, Math.random() to generate random numbers and etc. String
functions in JS enable you to manipulate and work with text data which has
methods like charAt(), concat(), toUpperCase().
a) Error
handling
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Error</title>
</head>
<body>
<script>
function
cal(){
let a =
123; let b
= 0; try{
if (b == 0) {
catch(e){
document.getElementById('demo').innerHTML= "from catch block :
"+"<b>" + e + "</b><br></br>";
finally {
</script>
<form>
</form>
</body>
</html>
Output:
b) Math
function
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
<p id="demo4"></p>
<p id="demo5"></p>
<p id="demo6"></p>
<p id="demo7"></p>
<p id="demo8"></p>
<p id="demo9"></p>
<p id="demo10"></p>
<p id="demo11"></p>
<p id="demo12"></p>
<script>
</script>
</body>
</html>
Output:
c) String and
test Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Javascript String</h1>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
<p id="demo4"></p>
<p id="demo5"></p>
<p id="demo6"></p>
<p id="demo7"></p>
<p id="demo8"></p>
<p id="demo9"></p>
<p id="demo10"></p>
<p id="demo11"></p>
<p id="demo12"></p>
<p id="demo13"></p>
<p id="demo14"></p>
<p id="demo15"></p>
<p id="demo16"></p>
<p id="demo17"></p>
<p id="demo18"></p>
<p id="demo19"></p>
<script>
document.getElementById('demo1').innerHTML = text.charAt(0);
document.getElementById('demo2').innerHTML = text.length;
document.getElementById('demo3').innerHTML =
text.charCodeAt(2);
document.getElementById('demo4').innerHTML = text.at(3);
document.getElementById('demo5').innerHTML = text.slice(2);
document.getElementById('demo6').innerHTML = text.substring(3,6);
document.getElementById('demo7').innerHTML = text.substr(1);
document.getElementById('demo8').innerHTML = text.toUpperCase();
document.getElementById('demo9').innerHTML = text.toLowerCase();
document.getElementById('demo10').innerHTML = text.concat(7);
document.getElementById('demo11').innerHTML = text.trim(5);
document.getElementById('demo12').innerHTML = text.trimStart(4);
document.getElementById('demo13').innerHTML = text.trimEnd(1);
document.getElementById('demo14').innerHTML = text.padStart(16,"*");
document.getElementById('demo15').innerHTML = text.padEnd(14,"*");
document.getElementById('demo16').innerHTML = text.repeat(2);
document.getElementById('demo17').innerHTML = text.replace();
document.getElementById('demo18').innerHTML = text.replaceAll();
document.getElementById('demo19').innerHTML = text.split();
</script>
</body>
</html>
Output:
Expt No 7:
Aim : To learn basics of bootstrap
Theory: Bootstrap is the most popular HTML, CSS, and JavaScript framework for
developing responsive, mobile-first websites.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-9">
<h1>
</h1>
</div>
</div>
<div class="row">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm12">
<h3>INTRODUCTION</h3>
Earrings are a power dressing tool for the modern working woman.
Whether your preference is for simple
gold or diamond studs, statement hooops and danglers, elaborate gold enmeshed
diamond hanging earrings
different sensibilities.</p><br>
tastes at competitive prices. We value what this simple piece of jewellery does to a
woman, and how it
makes her feel, Towards this end, we have diamond earrings that may be
the only adornment she needs on
for a family engagement, or even diamond studded jhumka earnings for a grand
bash. At ORRA, we have
everything!</p>
</div>
<br>
About
us<br>
Press<br>
Blogs<br>
</div>
<br>
orra_jewellery.insta.com</span><br> Orra.facebook.com<br>
Orra_7.twitter.com
</div>
<br>
1800-2661888<br>
customercare@orra.co.in<b
r> HR-
enquiries@orra.co.in
</div>
<br>
</div>
</div>
</div>
</body>
</html>
Output:
Expt No 8:
Aim : Learn to use different classes of bootstrap
Theory: Bootstrap provides a wide range of pre-defined CSS classes that can use to
style the web pages quickly and efficiently. These classes cover various design
aspects like layout, text formatting, forms, buttons, and navigation. For example,
classes such as "container," "row," and "col" which help create responsive layouts
easily.
Home.html
code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></
script>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
</div>
<li><a href="tours.html">Tours</a></li>
<li> <a href="booking.html">Booking</a></li>
</ul>
</nav>
</div>
<!--carousel-->
<div id="home">
<div class="container">
<ol class="carousel-indicators">
</ol>
<div class="carousel-inner">
</div>
<div class="item">
</div>
<div class="item">
</div>
</div>
<!-- right and left controls -->
<span class="sr-only">Previous</span>
</a>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</body>
</html>
Output:
places.html
code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></
script>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
</div>
<li><a href="home.html">Home</a></li>
<li><a href="tours.html">Tours</a></li>
</ul>
</nav>
</div>
</nav>
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
<p style="padding-left:40%">Beaches</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
<p style="padding-left:40%">Temple</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
<p style="padding-left:40%">Church</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
<p style="padding-left:40%">Waterfall</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="caption">
</div>
</a>
</div>
</div>
</div>
</body>
</html>
Output:
Tours.html
code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></
script>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
</div>
<li><a href="home.html">Home</a></li>
</ul>
</nav>
</div>
</nav>
<div class="container">
<h2>TOURS</h2>
<table class="table">
<thead>
<tr>
<th>Tours</th>
<th>Date</th>
<th>Schedule</th>
<th>Event status</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
<tr class="success">
</tr>
<tr class="danger">
</tr>
<tr class="info">
</tr>
<tr class="warning">
<td>Cancona tour</td>
</tr>
<tr class="active">
</tr>
</tbody>
</table>
</div>
</body>
</html>
Output:
Booking.html
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></
script>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
</div>
<ul class="nav navbar-nav">
<li><a href="home.html">Home</a></li>
<li><a href="tours.html">Tours</a></li>
</ul>
</nav>
</div>
</nav>
<br/>
<div class="form-group">
<div class="col-sm-9">
</div>
</div>
<div class="form-group">
</div>
</div>
<div class="form-group">
<br/>
</div>
</div>
<div class="form-group">
<div class="col-sm-9">
</div>
</div>
<div class="form-group">
<div class="col-sm-9">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9">
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-9">
</div>
</div>
<div class="form-group">
<div class="col-sm-9">
<textarea class="form-control" id="text"
placeholder="Write" name="text"></textarea>
</div>
</div>
<div class="form-group">
<div>
<button>Submit</button>
</div>
</div>
</form>
</body>
</html>
Output:
Jump.html
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 1</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></
script>
</head>
<body>
<div class="container-fluid">
<div class="navbar-header">
</div>
<li><a href="home.html">Home</a></li>
<li><a href="tours.html">Tours</a></li>
</ul>
</nav>
</div>
</nav>
<div class="jumbotron">
<div class="container">
<h1>Thank You</h1>
</div>
</div>
</body>
</html>
Output:
Expt No 9:
Aim : Learn about random function , if else , for loop and while loop
public class
RandomNumberExample1 { public
}
Output:
import java.util.Scanner;
public class
PrimeNumber {
public static void main(String[] args) {
// TODO code application logic
here int n, i, m=0, flag=0;
Scanner read = new
Scanner(System.in);
System.out.println("Enter numbers");
n=
read.nextInt();
m=n/2;
if(n==0 || n==1){
System.out.println(n+" is not prime number");
}else{
for(i=2;i<m;i+
+){ if(n
%i==0){
System.out.println(n+" is not a prime
number"); flag=1;
break;
}
}
if(flag==0) {
System.out.println(n+" is prime number");
}
}
}
}
Output:
c) Fibonacci series in
java Code:
package fibonacciseries;
import java.util.Scanner;
public class
Fibonacciseries {
public static void main(String[] args) {
// TODO code application logic here
int n1=0, n2=1,n3,i,count;
Scanner read = new
Scanner(System.in);
System.out.println("Enter numbers");
count= read.nextInt();
System.out.print(n1+" "+ n2);
for(i=2;i<count;++i)
{
n3=n1+n2;
System.out.print("
"+n3); n1=n2;
n2=n3;
}
}
}
Output:
d) Palindrome program in
java Code:
package palindrome;
import
java.util.Scanner;
public class
Palindrome {
temp=n;
while(n>0)
{
r=n%10;
sum=(sum*10)+
r; n=n/10;
}
if(temp==sum){
System.out.println("palindrome
number");
} else{
System.out.println(" not palindrome ");
}
}
}
Output:
e) Factorial program in
java Code:
package factorial;
import
java.util.Scanner;
Output:
Expt No 10:
Aim : Learn about how to reverse a number , to display even numbers from 1 to
100, to find sum of natural numbers , to find largest of 3 numbers and program to
sort an Array
Theory: Using while loop we can solve reverse program . Using for loop we can
iterate the loop and print only even numbers with if condition . Using for loop we
can print sum of natural numbers by taking user input. Using if else if for finding
largest of 3 numbers and by importing array class we can use Arraysort() function to
sort an array.
a) Reverse a number in
java Code:
package reversenumber;
import java.util.Scanner;
public class
ReverseNumber {
}
Output:
b) Java program to display even numbers from 1
to 100 Code:
package even_number;
public class
Even_Number {
}
Output:
sum_of_natural_numbrers; import
java.util.Scanner;
import java.util.Scanner;
public class
Largest_Number {
}
Output:
Arrays.sort(arrayname);
System.out.println("Elements of array sorted in ascending order: ");
}
Output:
Expt No 11:
Aim : Learn about classes and objects and method overloading
Theory: A class is a blueprint or template that defines the properties and behaviors
common to all objects . It serves as a blueprint for creating objects. An object is an
instance of a class. It represents a specific occurrence or realization of the class, with
its own set of data (attributes) and behaviors (methods). Method overloading is a
feature of Java that allows a class to have multiple methods with the same name
but different parameter lists.
}
Output:
b) Java
Overloading
Code:
package overloading;
}
Output:
Expt No 12:
Aim : Learn about the OOPs Concept in Java
a) Abstracti
on Code:
Shape.java
package abstraction2;
void display() {
System.out.println("This is a
shape");
}
}
Circle.java
package abstraction2;
Circle(double
radius) {
this.radius =
radius;
}
@Override
double calculateArea() {
return Math.PI * radius * radius;
}
}
Rectangle.java
package
abstraction2;
public class Rectangle extends
Shape { double length;
double width;
Rectangle(double length, double
width) { this.length = length;
this.width = width;
}
@Override
double calculateArea()
{ return length *
width;
}
}
Triangle.java
package abstraction2;
@Override
double calculateArea() {
return 0.5 * base *
height;
}
}
Abstraction2.java
package
abstraction2;
Output:
b) Inheritanc
e Code:
Animal.java
package inheritance;
public class
Animal { String
name;
public Animal(String
name){
this.name=name;
}
public Dog(String
name) { super(name);
}
@Override
public void sound(){
System.out.println("Woof");
}
Animal{ public
Cat(String name) {
super(name);
}
@Override
public void sound(){
System.out.println("Meow");
}
}
Inheritance.java
package
inheritance;
dog.sound();
cat.sound();
}
}
Output:
c) Polymorphis
m Code:
package polymorpshism;
public class
Polymorpshism {
System.out.println("Result of integer
addition:"+result1); System.out.println("Result of
integer addition:"+result2);
}
public static int add(int a, int
b){ return a + b;
}
}
Output:
d) Encapsulati
on Code:
Person.java
package
encapsulationprog; public
class Person {
private String
name; private int
age;
//Public constructor
public Person(String name, int
age){ this.name=name;
this.age=age;
}
//public getter for
name public String
getName(){
return name;
}
}
EncapsulationProg.java
package
encapsulationprog;
System.out.println("Original Information:");
System.out.println("Name: "+person.getName());
System.out.println("Age: "+person.getAge());
person.setName("Jane
Doe"); person.setAge(30);
System.out.println("\nUpdated Information");
person.displayInfo();
}
Output: