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

JS Questions

The document outlines 25 JavaScript programming challenges that involve tasks such as: 1) Getting the current date 2) Determining if a year is a leap year 3) Comparing a user's guess to a random number The challenges cover topics like date/time calculations, conditionals, user input/output, arrays, strings, and more. Students are to write JavaScript programs to solve each challenge and submit their solutions.

Uploaded by

Rohit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
363 views

JS Questions

The document outlines 25 JavaScript programming challenges that involve tasks such as: 1) Getting the current date 2) Determining if a year is a leap year 3) Comparing a user's guess to a random number The challenges cover topics like date/time calculations, conditionals, user input/output, arrays, strings, and more. Students are to write JavaScript programs to solve each challenge and submit their solutions.

Uploaded by

Rohit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CAP774 – DE703 Group-2C

Assignment
Submission Last Date: 20th April 2020

Solve all the Questions:

1) Write a JavaScript program to get the current date.


2) Write a JavaScript program to determine whether a given year is a leap year in
the Gregorian calendar.
3) Write a JavaScript program where the program takes a random integer between 1
to 10, the user is then prompted to input a guess number. If the user input matches
with guess number, the program will display a message "Good " otherwise display
a message "Not mapped"
4) Write a JavaScript program to calculate days left until next new year 2021.
5) Write a JavaScript program to check the total marks of a student 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 get A+ grade
and total marks must be greater than or equal to 90. Return true if the student get
A+ grade or false otherwise.
6) Write a JavaScript program to calculate multiplication and division of two
numbers (input from user).
7) Write a Java Script Program to print the prime numbers from 1 to 50.
8) Write a JavaScript program to convert temperatures to and from Fahrenheit,
Celsius.

Formula : c/5 = (f-32)/9


where c = temperature in Celsius and f = temperature in Fahrenheit

9) Write a JavaScript program to get the difference between a given number and
100, if the number is greater than 100 return double the absolute difference.
10) Write a JavaScript program to check from two given integers, whether one is
positive and another one is negative.
11) Write a Java Script Program to check whether a number entered by the user is
even or odd.
12) Write a JavaScript program to create a new string from a given string changing
the position of first and last characters. The string length must be greater than or
equal to 1.
13) Write a JavaScript program to capitalize the first letter of each word of a given
string.
14) Write a Java Script Program to apply the certain related string, numeric and
password validations with suitable example
15) Write a JavaScript program to create a new string from a given string taking the
last 3 characters and added at both the front and back. The string length must be
3 or more.
16) Write a JavaScript function to validate whether a given value type is boolean or
not.
17) Write a JavaScript function to validate whether a given value type is null or not.
18) Write a JavaScript function to validate whether a given value type is null or not.
19) Write a JavaScript program to filter out the specified values from a specified
array. Return the original array without the filtered values.
20) Write a Java Script Program to read a number and to find the factorial of given
number.
21) Write a JavaScript program to extract out the values at the specified indexes from
a specified array.
22) Write a JavaScript program to split values of two given arrays into two groups. If
an element in filter is truthy, the corresponding element in the collection belongs
to the first group; otherwise, it belongs to the second group.
23) Write a Java Script Program to check whether the string entered by the user is
palindrome or not, in the Alert Dialog box.
24) Write a JavaScript program to create a new array out of the two supplied by
creating each possible pair from the arrays.
25) Write a JavaScript program to get a sorted array of objects ordered by properties
and orders.

You might also like