Function 1: Password Checker function _one (pwd) Create a JavaScript function that meets the following requirements:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <STUDENT_ID>-problems.js, where STUDENT_ID represents your student number. 2. The implementation for your 5 JavaScript functions must be completed within your <STUDENT_ID>- problems.js file. 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 <STUDENT_ID>-problems.js, where STUDENT_ID represents your student number. 2. The implementation for your 5 JavaScript functions must be completed within your <STUDENT_ID>- problems.js file.
Expert Answer:
Answer rating: 100% (QA)
Function 1 Password Checker function onepwd Length check if pwdlength 8 pwdlength 12 consolelogThe p... View the full answer
Related Book For
Excellence in Business Communication
ISBN: 978-0136103769
9th edition
Authors: John V. Thill, Courtland L. Bovee
Posted Date:
Students also viewed these programming questions
-
In the same study cited in Example 1, another trial was conducted with 75 women in China given a 100-Yuan bill, while another 75 women in China were given 100 Yuan in the form of smaller bills (a...
-
Uphill escape ramps are sometimes provided to the side of steep downhill highways for trucks with overheated brakes. For a simple 11 upward ramp, what minimum length would be needed for a runaway...
-
Determine the number of pulses of equal duration that would be required to separate DNA strands of length 125 kbp and 250 kbp, respectively, by 1 mm, using PFGE. The electric field gradient in PFGE...
-
Use the same facts as problem 20 and prepare entries using the following independent assumptions: a. Lease A is abandoned in 2022. b. Lease A is proved in 2022. c. Insignificant Lease Y, with a cost...
-
The following information is available for Wenger Corporation for 2008. 1. Excess of tax depreciation over book depreciation, $40,000. This $40,000 difference will reverse equally over the years...
-
What are the drawbacks (disadvantages) of the relational database management system and of the object-oriented database system? What hardware or software support has been implemented for the...
-
Alex was in his friend Allison's home drinking straight vodka and doing drugs. Alex told Allison that he has not taken his prescribed mental health medications for two weeks. This did not concern...
-
Consider a consumer who lives for two periods. His utility is a function of consumption levels in periods 1 and 2 and is given by U(c1, c2) = clc2. His income in periods 1 and 2 are given by yl = y2...
-
to add to that the company demands a minimum 20% internal rate of return for capital projects. Does the 10-year rate of return meet the company requirements. assume that the company pays interest on...
-
The following code has been written to find out and display the maximum value in each column of a matrix: 1. 2. 3. { 4. int m[4] [2], i, j, colMax [2] ; 5. 6. 7. 8. 9. 10. 11. (a) #include "mbed.h"...
-
The fixed-charge coverage ratio requirements limits a company's ability to Multiple choice question. repurchase stock. enter into a merger with another company. pay off other debts. pay dividends.
-
What are the effects of coupon rate to the sensitivity of a bond price and to changes in interest rates?
-
Starbucks' decision to buy out its joint venture partner in Japan following several years of operation and instead establish a wholly owned subsidiary Multiple Choice suggests that the company no...
-
Which of the followings are depressant? * (1 Point) Alcohol Sleeping pills Cocaine Coffee
-
Find the image of x = k = const under w = 1/z. Use formulas similar to those in Example 1. y| y = 0 -21 -2 -1 -1, /1 12 T -1 -1 y= -2 x =0
-
The CEO has asked for a short report, summarizing the data and information you have on engineering and marketing salaries. Feel free to offer your own interpretation of the situation as well (make up...
-
The following e-mail message contains numerous errors related to what you've learned about planning and writing business messages. Using the information it contains, write a more effective version....
-
Which of the following is the most effective call to action to encourage interested moms to sign up for free CafeMom membership? a. Sign up for your free Join CafeMom membership today and get...
-
Volunteer work can improve your skills and enhance your rsum. With a partner, seek volunteer opportunities on your campus or in your city. Make a list of volunteer groups that may need help. Here are...
-
What are six brainstorming questions to consider before starting your proposal?
-
What is the difference between a competitive and noncompetitive proposal?
Study smarter with the SolutionInn App