Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Function 1: Password Checker function _one (pwd) Create a JavaScript function that meets the following requirements: Is passed a string representing a potential password
Function 1: Password Checker function _one (pwd) Create a JavaScript function that meets the following requirements: Is passed a string representing a potential password The function determines if the password meets the following requirements The length of the password is between 8 - 12 characters Contains at least 1 number (numeric character) Contains at least 1 special character Special characters are punctuation characters that are present on standard keyboard namely any character encapsulated within the following double quotes "(!"#$%&'()*+,-/:; ?@N\^_`{|}~)" Contains at least 1 capital letter The function should NOT employ the use of regular expressions to solve the problem The function also displays the result (console log) of its password validation as illustrated below. The function returns a Boolean back to the caller indicating valid or not. Calling _one(labc!Caa) The password labc!Caa is valid Calling one (labccca) The password 1abccca is NOT valid Calling one (11bc!aaa) The password 11bc!aaa is NOT valid Calling _one(labccDdfa) The password 1abccDdfa is NOT valid Function 2: Calculate Remainder function _two (dividend, divisor) Create a JavaScript function that meets the following requirements: Is passed two integer parameters, one representing a dividend, and the other a divisor. The function is NOT permitted to use the % (mod) operator The function can use any combination of +, -, * or to solve the problem The function displays the calculated remainder (console log) as illustrated below: The function returns the result of the calculation back to the caller. Calling two (9, 3) The calculated modulus value is: Calling_two(9, 0) undefined Calling two(-9, 3) unsigned numbers supported only Function 3: Volume of Cylinder function _three (radius, height) Create a JavaScript function that meets the following requirements: Receives two parameters, one representing a radius value, the other a height value The function can safely assume, all parameters passed are represented in meters (m). The function calculates the volume of a cylinder and returns the value back to its caller. The function always displays the calculated volume, rounded to two significant digits The function displays the calculated information (console log) as illustrated below: The function returns the calculated volume back to the caller Calling three(5, 25) The calculated volume is: 1963.50 Calling three(0, 25) The calculated volume is: 0.00 Calling three(-5, 25) Radius and height must be greater than 0 Function 4: Class Grading function _four ( array) Create a JavaScript function that meets the following requirements: Receives a variable length array of numbers, representing student grades in a course The function traverses the array to determine the number of passing and failing grades. o A passing grade, is grade greater than or equal to 50 The function displays the count (console log) for the number passing grades, failing grades and overall class average as illustrated below Average class grade is rounded to 1 decimal point The function returns the array containing the number of passing grades, the number of failing grades, and the overall averages of the grades, respectively, back to the caller Calling four ([50,51,80,45]) The number of passing grades: 3, failing grades: 1, and class average: 56.5 Calling four ([35,45,25,10,6,33]) The number of passing grades: 0, failing grades: 6, and class average: 25.7 Calling four ([80,90]) The number of passing grades: 2, failing grades: 0, and class average: 85.0 Function 5: Count Occurrences function _five (text, pattern) Create a JavaScript function that meets the following requirements: Accepts two string parameters, a principal string and pattern string. The function determines if the pattern string exists within the principal string. The function displays the result (console log) as illustrated below. The function returns a Boolean back to the caller, indicating if the pattern was found. Calling five (George Brown, or) The pattern exists in the text string Calling five (George Brown, OR) The pattern does not exist in the text string Calling five (George Brown, Nancy) The pattern does not exist in the text string 1. You are to create ONE JavaScript file which must be named -problems.js, where STUDENT_ID represents your student number. 2. The implementation for your 5 JavaScript functions must be completed within your - problems.js file.
Step by Step Solution
★★★★★
3.54 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Function 1 Password Checker function onepwd Length check if pwdlength 8 pwdlength 12 consolelogThe p...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started