0% found this document useful (0 votes)
2 views

JavaScriptAssignmentIndex-1

The document is a certificate of completion for a student at M. D. Palesha Commerce College, confirming the successful completion of 12 practicals in Scripting Languages for the academic year 2024-2025. It includes an index of practicals covering various JavaScript and Python programming tasks, such as validating input and calculating factorials. The certificate is signed by the subject teacher and the head of the department.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

JavaScriptAssignmentIndex-1

The document is a certificate of completion for a student at M. D. Palesha Commerce College, confirming the successful completion of 12 practicals in Scripting Languages for the academic year 2024-2025. It includes an index of practicals covering various JavaScript and Python programming tasks, such as validating input and calculating factorials. The certificate is signed by the subject teacher and the head of the department.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Dhule Education Society’s

M. D. Palesha Commerce College, Dhule


Department of Computer
Certificate of Completion

Date: 24 Oct 2024

This is to certify that _____________________________________________________


Student of T.Y.B.M.S. (e-Commerce) Semester – V, has satisfactorily
completed 12 practical’s in the Subject E 5.7 Practical on Scripting
Lanaguages as laid down by the North Maharashtra University, Jalgaon for
the academic Year 2024-2025.

H. P. Jain
(Subject Teacher) HOD / Principal

Internal Examiner External Examiner


Dhule Education Society’s

M. D. Palesha Commerce College, Dhule

Scripting Language Index

Sr. Title Date Sign


No.

1. Study of Popup Boxes in Java script.

2. Java script to print Odd and Even numbers in given range.

3. Java script to print Factorial of a given number.

4. Java script to print 15 terms of Fibonacci Series

5. Java script to demonstrate use of procedure and functions

6. Demonstration of Exception Handling using Java script.

7. Java script to validate a Number.

8. Java script to validate NOT NULL data / value.

9. Java script to validate E-Mail address.

10. Python program to print number is Positive or Negative

11. Python program to print first n numbers

12. Python program to print factorial of a given numbers


<!-- JavaScript code to demonstrate the use of various dialog boxes -->

<HTML>
<HEAD>
<TITLE>
Popup Boxes
</TITLE>

<SCRIPT LANGUAGE="JAVASCRIPT">
function display()
{
var n
n = prompt( "Enter the Number", "Text" );

if ( isNaN( n ) )
{
confirm( "Invalid Number" );
}
else
{
alert( "Given number is " + n );
}
}
</SCRIPT>
</HEAD>

<BODY>
<FORM NAME="frm">
<INPUT TYPE=submit VALUE="Submit" onclick=display()>
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to print Odd and Even numbers in given range -->
<HTML>
<HEAD>
<TITLE>
Odd and Even in Range
</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function even()
{
var n, n1, i;
n = parseInt( document.getElementById( "t1" ).value );
n1 = parseInt( document.getElementById( "t2" ).value );
document.write( "<h1>Even numbers between " + n + " and " + n1 + " are</h1>");
i = n;
while( i <= n1 )
{
if (i%2 == 0 )
document.write( i + "<br>" );
i++;
}

document.write( "<h1>Odd numbers between " + n + " and " + n1 + " are</h1>");
i = n;
while( i <= n1 )
{
if (i%2 != 0 )
document.write( i + "<br>" );
i++;
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
Enter Starting Number
<INPUT TYPE=text ID="t1"> <br>
Enter End Number
<INPUT TYPE=text ID="t2"> <p>
<INPUT TYPE=button VALUE="Display Numbers" ID="b1" onclick="even()">
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to print factorial of a given number -->
<HTML>
<HEAD>
<TITLE>
Factorial of Number
</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function factorial()
{
var n, i, fact;

n = parseInt( document.getElementById( "t1" ).value );

for (i = 1, fact = 1; i <= n; i++ )


{
fact = fact * i;
}

document.write( "<h1>Factorial of " + n + " is " + fact + "</h1>");


}
</SCRIPT>
</HEAD>

<BODY>
<FORM NAME="frm">
Enter Number for Factorial
<INPUT TYPE=text ID="t1"> <p>
<INPUT TYPE=button VALUE="Display" ID="b1" onclick="factorial()">
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to demonstrate the use of exception handling -->
<HTML>
<HEAD>
<TITLE>
Exception Handling
</TITLE>

<SCRIPT LANGUAGE=“JavaScript”>
function division()
{
var a, b, c;

try
{
a = document.getElementById( "t1" ).value ;
b = document.getElementById( "t2" ).value ;

if ( isNaN( a ) || isNaN( b ) )
throw "Invalid Number(s)";

if ( b == 0 )
throw "Divide by ZERO error";

c = a / b;

document.write( "<h1>Division of " + a + " by " + b + " is " +c );


}
catch( e )
{
document.write( "<h1>Error is " + e );
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
Enter First Number
<INPUT TYPE=text ID="t1">
<p>
Enter Second Number
<INPUT TYPE=text ID="t2">
<p>
<INPUT TYPE=button ID="b1" VALUE="Display" onclick="division()">
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to demonstrate the use of null validation-->
<HTML>
<HEAD>
<TITLE>
NULL Validation
</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function nullvalidate()
{
var n;
try
{
n = document.getElementById( "t1" ).value ;
if ( n == null || n == "" )
throw "Null Value";
document.write( "<h1>Given Data is " + n );
}
catch( e )
{
document.write( "<h1>Error is " + e );
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
Enter the Data
<INPUT TYPE=text id="t1">
<p>
<INPUT TYPE=button ID="b1" VALUE="Display" onclick="nullvalidate()">
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to demonstrate the use of number validation-->
<HTML>
<HEAD>
<TITLE>
Number Validation
</TITLE>

<SCRIPT LANGUAGE=“JavaScript”>
function numvalidate()
{
var n;
try
{
n = document.getElementById( "t1" ).value ;
if ( n == null || n == "" )
throw "Not a Number";
if ( isNaN( n ) )
throw "Invalid Number";
document.write( "<h1>Given number is " + n );
}
catch( e )
{
document.write( "<h1>Error is " + e );
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
Enter the Number
<INPUT TYPE=text id="t1">
<p>
<INPUT TYPE=button ID="b1" VALUE="Display" onclick="numvalidate()">
</FORM>
</BODY>
</HTML>
<!-- JavaScript code to demonstrate the use of email validation-->
<HTML>
<HEAD>
<TITLE>
email Address Validation
</TITLE>
<SCRIPT LANGUAGE=“JavaScript”>
function emailvalidate()
{
var emailaddress;
try
{
emailaddress = document.getElementById( "t1" ).value ;
if ( emailaddress == null || emailaddress == "" )
throw "No email address";
atposition = emailaddress.indexOf( "@" );
dotposition = emailaddress.lastIndexOf( "." );
if ( atposition < 1 || (dotposition-atposition) < 2 )
throw "Invalid email address";
document.write( "<h1>Given email address is " + emailaddress );
}
catch( e )
{
document.write( "<h1>Error is : " + e );
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
Enter email Address
<INPUT TYPE=text ID="t1">
<P>
<INPUT TYPE=button ID="b1" VALUE="Display" onclick="emailvalidate()">
</FORM>
</BODY>
</HTML>
#Python program to print whether number is positive or negative

n = int(input("Enter any number"))


if n >= 0:
print(n, " is POSITIVE")
else:
print(n, " is NEGATIVE")

#Python program to print first n numbers

n = int(input("Enter How many number"))


i=1
print( "First ", n, "numbers are")
while i <= n:
print( i )
i=i+1

#Python program to print factorial of a given number


n = int(input("Enter Number for Factorial"))
i=1
fact = 1
while i <= n:
fact = fact * i
i=i+1
print( "Factorial of " , n, " is ", fact)

You might also like