Giter Site home page Giter Site logo

js_exercise's Introduction

JS Exercise

  1. Write a JavaScript program to display the current day and time in the following format.
    Sample Output : Today is : Tuesday. Current time is : 10 PM : 30 : 38

  2. Write a JavaScript program to print the current window contents.

  3. Write a JavaScript program to get the current date.
    Expected Output : mm-dd-yyyy, mm/dd/yyyy or dd-mm-yyyy, dd/mm/yyyy

  4. Write a JavaScript program to find the area of a triangle where three sides are 5, 6, 7.

  5. 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.

  6. Write a JavaScript program to determine whether a given year is a leap year in the Gregorian calendar.

  7. Write a JavaScript program to find out if 1st January will be a Sunday between 2014 and 2050.

  8. 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".

  9. Write a JavaScript program to calculate the days left before Christmas.

  10. Write a JavaScript program to calculate multiplication and division of two numbers (input from the user).
    Sample form : sample form

  11. Write a JavaScript program to convert temperatures to and from Celsius, Fahrenheit.
    [ Formula : c/5 = (f-32)/9 [ where c = temperature in Celsius and f = temperature in Fahrenheit ] Expected Output : 60°C is 140 °F 45°F is 7.222222222222222°C

  12. Write a JavaScript program to get the website URL (loading page).

  13. Write a JavaScript exercise to create a variable using a user-defined name.

  14. Write a JavaScript exercise to get the filename extension.

  15. 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.

  16. 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.

  17. Write a JavaScript program to compute the absolute difference between a specified number and 19. Returns triple the absolute difference if the specified number is greater than 19.

  18. Write a JavaScript program to check a pair of numbers and return true if one of the numbers is 50 or if their sum is 50.

  19. Write a JavaScript program to check whether a given integer is within 20 of 100 or 400.

  20. Write a JavaScript program to check two given integers whether one is positive and another one is negative.

  21. 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.

  22. Write a JavaScript program to remove a character at the specified position in a given string and return the modified string.

  23. 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.

  24. 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.

  25. Write a JavaScript program to check whether a given positive number is a multiple of 3 or 7.

  26. 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.

  27. Write a JavaScript program to check whether a string starts with 'Java' if it does not otherwise.

  28. Write a JavaScript program to check whether two given integer values are in the range 50..99 (inclusive). Return true if either of them falls within the range.

  29. Write a JavaScript program to check whether three given integer values are in the range 50..99 (inclusive). Return true if one or more of them are in the specified range.

  30. 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.

  31. Write a JavaScript program to find the largest of three given integers.

  32. Write a JavaScript program to find the closest value to 100 from two numerical values.

  33. Write a JavaScript program to check whether two numbers are in the range 40..60 or 70..100 inclusive.

  34. Write a JavaScript program to find the largest number from the two given positive integers. The two numbers are in the range 40..60 inclusive.

  35. Write a program to check whether a specified character exists between the 2nd and 4th positions in a given string.

  36. Write a JavaScript program that checks whether the last digit of three positive integers is the same.

  37. Write a JavaScript program to produce a new string that has the first 3 characters in lower case from a given string. If the string length is less than 3 convert all the characters to upper case.

  38. Write a JavaScript program to check a student's total marks in various examinations. The student will get A+ grade if the total marks are in the range 89..100 inclusive, if the examination is "Final-exam" the student will receive A+ grade and total marks must be greater than or equal to 90. If the student gets an A+ grade, return true, otherwise return false.

  39. Write a JavaScript program to compute the sum of the two given integers. If the sum is in the range 50..80 return 65 otherwise return 80.

  40. Write a JavaScript program to check from two given integers whether one of them is 8 or their sum or difference is 8.

  41. Write a JavaScript program to check a set of three numbers; if the three numbers are the same return 30; otherwise return 20; and if two numbers are the same return 40.

  42. Write a JavaScript program to check whether three given numbers are increasing in strict or in soft mode.
    Note: Strict mode -> 10, 15, 31 : Soft mode -> 24, 22, 31 or 22, 22, 31

  43. Write a JavaScript program to check from three given numbers (non negative integers) that two or all of them have the same rightmost digit.

  44. Write a JavaScript program to check from three given integers whether a number is greater than or equal to 20. It is less than the others.

  45. Write a JavaScript program that checks two integer values and returns true if either one is 15 or if their sum or difference is 15.

  46. Write a JavaScript program to check two given non-negative integers if one (not both) is a multiple of 7 or 11.

  47. Write a JavaScript program to check whether a given number exists in the range 40..10000.
    For example 40 presents in 40 and 4000

  48. Write a JavaScript program to reverse a given string.

  49. Write a JavaScript program to replace every character in a given string with the character following it in the alphabet.

  50. Write a JavaScript program to capitalize the first letter of each word in a given string.

js_exercise's People

Contributors

ishantl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.