Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Final function final ( ) { / * Question No . 6 ( 1 0 pts ) : Write a statement to get the input

Final
function final(){
/*Question No.6(10pts) : Write a statement to get the input from the user and assign it to a "let" type variable called 'userInput'*/
let userInput = document.getElementById("userInput").value;
var lowerCaseLetter =/[a-z]/g; // regular expression a-z
var upperCaseLetter =/[A-Z]/g; // regular expression A-Z
var number =/[1-9]/g; // regular expression 1-9
var a=[];
/*
Question No.7(20pts) :
Given that "userInput.match(regular expression)" is the function to check if the userInput match the regular expression or not and its return value is null when not matching.
Given that "userInput.length" is the length of the user input.
Write "if-else" statements to check if the user input meet each requirement or not.
You can use integer array a=[] to store the comparison results, so the sum of the comparison results can be used as a unique number to reflect if the user input met the requirements or not.
*/
/*Question No.8(20pts) : Use the result of Question No.7 as the value of case to in "switch-case" statement to output the appropriate error when the user input meet or does not meet one or more requirements.*/
}
Your Full NameUser Input Must Contain: A lowercase letter from a to z, A uppercase letter from A to Z, A number from 1-9, Maximum 8 characters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions