WINSEM2014-15_CP1675_23-Feb-2015_RM01_Javascript.docx

2
1. Write a Java script for displaying current date on your web page. 2. Write a Java Script to create an array object and perform the following functionalities: Join three arrays Join all elements of an array into a string Remove the last element of an array Add new elements to the end of an array Reverse the order of the elements in an array Remove the first element of an array Sort an array alphabetically and numerically – ascending and descending Convert an array to a string Add new elements to the beginning of an array 3. Write a Javascript code that accepts a number from the user and displays its factorial only if it is a prime number. 4. Create a program that accepts the time from the system clock and accordingly displays a Good Morning, Good Afternoon or Good Evening message to the user. 5. Develop a simple calculator using java Script code. SIMPLE CALCULATOR Enter the first number :

Transcript of WINSEM2014-15_CP1675_23-Feb-2015_RM01_Javascript.docx

1. Write a Java script for displaying current date on your web page.

2. Write a Java Script to create an array object and perform the following

functionalities:

Join three arrays

Join all elements of an array into a string

Remove the last element of an array

Add new elements to the end of an array

Reverse the order of the elements in an array

Remove the first element of an array

Sort an array alphabetically and numerically ascending and

descending

Convert an array to a string

Add new elements to the beginning of an array

3. Write a Javascript code that accepts a number from the user and displays

its factorial only if it is a prime number.

4. Create a program that accepts the time from the system clock and accordingly displays a Good Morning, Good Afternoon or Good Evening message to the user.

5. Develop a simple calculator using java Script code.

SIMPLE CALCULATOR

Enter the first number :

Enter the second number :

Select the operation :