Download JavaScript exercise questions and more Assignments Computer science in PDF only on Docsity!
Assignment # 12- JAVASCRIPT
IF…ELSE & ELSE IF STATEMENT,
TESTING SET OF CONDITIONS
Write a program that takes a character (number or string) in a variable & checks whether the given input is a number, uppercase letter or lower case letter. (Hint: ASCII codes:- A=65, Z=90, a=97, z=122).
Write a JavaScript program that accept two integers and display the larger. Also show if the two integers are equal.
Write a program that takes input a number from user & state whether the number is positive, negative or zero.
Write a program that takes a character (i.e. string of length 1) and returns true if it is a vowel, false otherwise
Write a program that a. Store correct password in a JS variable. b. Asks user to enter his/her password c. Validate the two passwords: i. Check if user has entered password. If not, then give message “ Please enter your password” ii. Check if both passwords are same. If they are same, show message “Correct! The password you entered matches the original password”. Show “Incorrect password” otherwise.