SOP 1: Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt functions, and control structures.
- To accept an integer and display the result by multiplying it with 3.
- To accept two integers and display a larger number of them.
- To check whether the user entered number is positive or negative.
Answer:
To accept integer and display the result by multiplying it with 3.
<!DOCTYPE html>
<head>
<title>To accept integer and display the result by multiplying it with 3.</title>
</head>
<body>
<script language=”javascript”> var a,no,ans;
a=prompt(Enter any value’);
no=parseInt(a);
ans=no*3;
document.
write(“The answer is :”+ans);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 1 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.png?resize=406%2C233&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 2 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.1](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.1.png?resize=275%2C222&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 3 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript)](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/08/Maharashtra-Board-Solutions.png?resize=215%2C13&ssl=1)
To accept two integers and display larger number of them.
<!DOCTYPE html>
<head>
<title>To accept two integers and display larger number of them.</title>
</head>
<body>
<script language=”javascript”>
var a,b;
a=prompt(‘Enter first value’);
b=prompt(‘Enter second value’);
if(a>b)
document.write(“a is large number than b “);
else
document. write(“b is large number than a”);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 4 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.2](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.2.png?resize=502%2C398&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 5 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.3](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.3.png?resize=454%2C194&ssl=1)
To check whether, user entered number is positive or negative.
<!DOCTYPE html>
<head>
<title>To check whether, user entered number is positive or negative</title>
</head>
<body>
<script language=”javascript”>
var a,no;
a=prompt(‘Enter any number’);
no=parseInt(a);
if(no>0)
document.write(“Number is Positive”);
else
document.write(“Number is Negative”);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 6 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.4](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.4.png?resize=372%2C224&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 7 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.5](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.5.png?resize=417%2C421&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 8 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 1.6](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-1.6.png?resize=410%2C247&ssl=1)
SOP 2: Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt functions, and control structures.
- To accept two positive or negative numbers and check whether they are equal or not.
- To accept a number and display the square of it.
- To check whether the accepted integer is multiple of 3 or multiple of 7.
Answer:
To accept two positive or negative numbers and check whether they are equal or not.
<!DOCTYPE html>
<head>
<title>program3</title>
</head>
<body>
<script language=”javascript”> var no1,no2;
no1=prompt(‘Enter first number’);
no2=prompt(‘Enter Second number’);
if(no1==no2)
document.write(“Both are equal”);
else
document.write(“Given numbers are not equal”);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 3 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript)](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/08/Maharashtra-Board-Solutions.png?resize=215%2C13&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 10 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 2](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-2.png?resize=464%2C475&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 11 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 2.1](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-2.1.png?resize=449%2C208&ssl=1)
To accept number and display square of it.
<!DOCTYPE html>
<head>
<title>To accept number and display square of it</title>
</head>
<body>
<script language-’j avascript”>
var no,sqr;
no=prompt(‘Enter Any number’);
sqr=no*no;
document, write (“The Square is=”+sqr);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 12 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 2.2](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-2.2.png?resize=308%2C426&ssl=1)
To check whether the accepted integer is multiple of 3 or multiple of 7.
<!DOCTYPE html>
<html>
<head>
<title>To check whether the accepted integer is multiple of 3 or multiple of 7.</title>
</head>
<body>
<script language=JavaScript>
var a;
a=prompt(“Enter your first interger / number”);
if(a%3==0 | | a%7==0)
alert(“multiple of 3 or 7”);
else
alert(“not a multiple of 3 or 7”);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 13 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 2.3](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-2.3.png?resize=352%2C454&ssl=1)
SOP 3: Create a JavaScript program for the following using appropriate variables, JavaScript inbuilt string functions, and control structures.
- To accept a string and calculate its length.
- To accept a string and display it in lowercase and uppercase.
- To check whether the length of the string is 4 or greater.
Answer:
To accept a string and calculate its length.
<!DOCTYPE html>
<head>
<title>program8</title>
</head>
<body>
<script language=”javascript”>
var a;
a=prompt(‘Enter string’);
document.write(“The length is=”+a.length);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 3 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript)](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/08/Maharashtra-Board-Solutions.png?resize=215%2C13&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 15 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 3](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-3.png?resize=325%2C216&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 16 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 3.1](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-3.1.png?resize=324%2C234&ssl=1)
To accept string and display it into lowercase and uppercase.
<!DOCTYPE html>
<head>
<title> To accept string and display it into lowercase and uppercase</title>
</head>
<body>
<script language=”javascript”>
var a;
a=prompt(‘Enter any string’);
document.write(“<br>Entering Strings “+a);
document.write(“<br>Lowercase=”+a.toLowerCase());
document.writeln(“<br>Uppercase=”+a.toUpperCase());
</script>
</body>
</html>
To check whether the length of string is 4 or greater.
<!DOCTYPE html>
<html>
<head>
<title> JavaScript</title>
</head>
<body>
<script language=JavaScript>
var a,b;
a=prompt(“Enter your text”);
b=a.length;
if(b=4 || b>=4)
alert(‘‘your length is 4 or greater”);
else
alert(“your text length is below 4”);
</script>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 18 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 3.3](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-3.3.png?resize=312%2C185&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 19 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 3.4](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-3.4.png?resize=332%2C169&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 3 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript)](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/08/Maharashtra-Board-Solutions.png?resize=215%2C13&ssl=1)
SOP 4: Create event-driven JavaScript programs for the following using appropriate variables, JavaScript inbuilt functions, and control structures.
To accept numbers and validate if the given value is a number or not by clicking on the button.
To calculate the addition and division of two numbers.
Answer:
To accept number and validate if the given value is a number or not by click
<!DOCTYPE html>
<html>
<head>
<title> To accept number and validate if the given value is a number or not by clicking on the button.
</title>
</head>
<script language-’JavaScript”>
function display()
{
var a,b;
a=form1.t1;value;
if(a>=0)
alert(“Value is a number”+” “+a);
else
alert(“Value is a string”+” “+a);
}
</script>
</head>
</body>
<form name=form1>
Enter Value: <Input type=text name=t1><br><br>
<Input type=button value=Check onClick=”display()”>
</form>
</body>
</html>
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 23 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 4](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-4.png?resize=254%2C279&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 24 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 4.1](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-4.1.png?resize=250%2C179&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 25 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) SOP 4.2](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/10/Maharashtra-Board-Class-11-Information-Technology-Practicals-Skill-Set-3-Client-Side-Scripting-JavaScript-SOP-4.2.png?resize=308%2C169&ssl=1)
![Maharashtra State Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript) 3 Maharashtra Board Class 11 Information Technology Practicals Skill Set 3 Client Side Scripting (JavaScript)](https://i0.wp.com/maharashtraboardsolutions.guru/wp-content/uploads/2021/08/Maharashtra-Board-Solutions.png?resize=215%2C13&ssl=1)
To calculate addition and division of two numbers.
<!DOCTYPE html>
<head>
<title>To calculate addition and division of two numbers.</title>
<script langauge=”javascript”>
function add()
{
var a,b,result;
a=f1.t1.value;
b=f1.t2.value;
result=parselnt(a)+parselnt(b);
document.write(“The Addition is =”+result);
}
function div()
{
var a,b,d;
a=f1.t1.value;
b=f1.t2.value;
d=parselnt(a)/parselnt(b);
document.write(“The Divide is =”+d);
}
</script>
</head>
<body>
<form name=”f1”>
1st Number : <input type=”text” name=”t1”><br>
2nd Number : <input type=”text” name=”t2”><br>
<input type=”button” value=”Addition” name=”b1” onClick=”add()”>
<input type=”button” value=”Division” name=”b2” onClick=”div()”>
</form>
</body>
</html>