Page 1 of 1

Lab Exercises: Exercise 1 Write a javascript code that will ask the user two things: 1. Please enter a student mark betw

Posted: Wed Apr 27, 2022 3:41 pm
by answerhappygod
Lab Exercises Exercise 1 Write A Javascript Code That Will Ask The User Two Things 1 Please Enter A Student Mark Betw 1
Lab Exercises Exercise 1 Write A Javascript Code That Will Ask The User Two Things 1 Please Enter A Student Mark Betw 1 (44.93 KiB) Viewed 30 times
Lab Exercises: Exercise 1 Write a javascript code that will ask the user two things: 1. Please enter a student mark between (0-100) 2. Do you want to print the value in the log console or the document? After the user inserts the number, you need to check if the number is between 0 and 100, if the number is not then you must use the JS ALERT to notify the user that the mark is invalid, if yes then you need to check if the mark exceeds 50, if yes then print "Pass", if no then print "Fail". Based on the answer of the second question, the script must either print the response to the log console or the document. Exercise 2 Write a javascript code that will ask the user to enter an email address then the js code needs to verify that the email address inserted by the user is a valid email address. A valid email address must pass the following conditions: Contains @sign The domain of the email is a valid domain (std.psu.edu.jo) The email id (username) length is not greater than 11 characters. If the email passes the conditions, then write on the page document "Valid Email Address", else write on the page document "Invalid Email Address" Example: validate_email'ema [email protected]") //prints "Valid Email Address* [email protected]") //prints "Invalid Email Address Exercise 3 Write a javascript code that asks the user to enter a string and prints it in reverse. Example: change_str("Hello") //prints "olleH' change_str(World") //prints "droW