JavScriptandjQueryExcercises
JavScriptandjQueryExcercises
1. Write a JavaScript program to find the area of a triangle where three sides are 5,
6, 7.
2. Write a JavaScript program to rotate the string 'w3resource' in the right direction.
This is done by periodically removing one letter from the string end and attaching
it to the front.
3. Write a JavaScript program to determine whether a given year is a leap year in
the Gregorian calendar.
4. Write a JavaScript program where the program takes a random integer between
1 and 10, and the user is then prompted to input a guess number. The program
displays a message "Good Work" if the input matches the guess number
otherwise "Not matched".
5. Write a JavaScript program to calculate multiplication and division of two
numbers (input from the user).
6. Write a JavaScript program to get the difference between a given number and
13, if the number is broader than 13 return double the absolute difference.
7. Write a JavaScript program to compute the sum of the two given integers. If the
two values are the same, then return triple their sum.
8. Write a JavaScript program to create another string by adding "Py" in front of a
given string. If the given string begins with "Py" return the original string.
9. Write a JavaScript program to remove a character at the specified position in a
given string and return the modified string.
10. Write a JavaScript program to create a new string from a given string by
changing the position of the first and last characters. The string length must be
broader than or equal to 1.
11. Write a JavaScript program to create another string from a given string with the
first character of the given string added to the front and back.
12. Write a JavaScript program to create a string from a given string. This is done by
taking the last 3 characters and adding them at both the front and back. The
string length must be 3 or more.
13. Write a JavaScript program to check whether a string starts with 'Java' if it does
not otherwise.
14. Write a JavaScript program to check whether a string "Script" appears at the 5th
(index 4) position in a given string. If "Script" appears in the string, return the
string without "Script" otherwise return the original one.
15. Write a program to check whether a specified character exists between the 2nd
and 4th positions in a given string.