In this assignment, you are to develop a JavaScript file (problems.js) that contains the implementation of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this assignment, you are to develop a JavaScript file (problems.js) that contains the implementation of 5 functions. Each function is represented as one step, and marks will be awarded on the completion of each step (each function). Each function is independent and solves a unique problem, as such, treat and implement each function in isolation of the others, that is, you should only focus on one problem at a time. PLEASE NOTE: Unless indicated within the question(s), input validation is NOT required for a functions input parameters - You may assume that all input parameters provided to your functions, are valid. Your JavaScript functions file must be configured for strict mode ("use strict") The pages that follow provide the description of the 5 JavaScript functions that you must implement 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 9 12 requirements o The length of the password is between 8-12 characters o Contains at least 1 number (numeric character) o 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^_{1}-)" o Contains at least 1 capital letter. The function should NOT employ the use of regular expressions to solve the empr 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. 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. 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 o 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 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 grade The course array to determine the number of passing and failing graden smy 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, can cont pione failing grades and overall class average as Tavo a rado in illustrated below. Average class grade is rounded pint The fun fure the to 1 decimal point The function returns the array containing the number of passing grades, the numb overall number of failing grades, and the overall averages of f the grades, respectively, back to the caller 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 Please ensure to remove all instances of the following from your final submission solution:. document.write() innerHTML(). alert() any commented code. Do not over use the console log, spamming the console log unnecessarily, say for example, with debug related output may cost you marks. In this assignment, you are to develop a JavaScript file (problems.js) that contains the implementation of 5 functions. Each function is represented as one step, and marks will be awarded on the completion of each step (each function). Each function is independent and solves a unique problem, as such, treat and implement each function in isolation of the others, that is, you should only focus on one problem at a time. PLEASE NOTE: Unless indicated within the question(s), input validation is NOT required for a functions input parameters - You may assume that all input parameters provided to your functions, are valid. Your JavaScript functions file must be configured for strict mode ("use strict") The pages that follow provide the description of the 5 JavaScript functions that you must implement 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 9 12 requirements o The length of the password is between 8-12 characters o Contains at least 1 number (numeric character) o 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^_{1}-)" o Contains at least 1 capital letter. The function should NOT employ the use of regular expressions to solve the empr 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. 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. 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 o 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 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 grade The course array to determine the number of passing and failing graden smy 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, can cont pione failing grades and overall class average as Tavo a rado in illustrated below. Average class grade is rounded pint The fun fure the to 1 decimal point The function returns the array containing the number of passing grades, the numb overall number of failing grades, and the overall averages of f the grades, respectively, back to the caller 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 Please ensure to remove all instances of the following from your final submission solution:. document.write() innerHTML(). alert() any commented code. Do not over use the console log, spamming the console log unnecessarily, say for example, with debug related output may cost you marks.
Expert Answer:
Related Book For
Statistics For Business And Economics
ISBN: 9780132745659
8th Edition
Authors: Paul Newbold, William Carlson, Betty Thorne
Posted Date:
Students also viewed these programming questions
-
DH Auctioneers South Australians have come to know DH Auctioneers as THE company to go to for auctioning off antiques, unique pieces, and hard to find collectables. The knowledge, expertise, and...
-
Roberts Originals Co. (ROC) provides new and unique cases and otherassignments to professors each semester to ensure that students will not be able to find the solutions published online. Due to the...
-
Are governments and not-for-profit organizations required to prepare budgets?
-
Is there a difference between a plan and a strategy?
-
What are the advantages to making a CCP 998 offer?
-
Applying the net present value approach with and without tax considerations Paxton Kingsley, the chief executive officer of Kingsley Corporation, has assembled his top advisers to evaluate an...
-
A sensor has an output voltage (V) with varying input s according to the following transfer function: V=m*s/(n+s). Here m is 10 and n is 5. a) When s=1, what is the output voltage of this sensor?...
-
3. The Folly and Frill company is in the process of liquidation. On January 1, 2011, the general ledger shows the account balances as follows: Cash $10,000 Accounts payable 15,000 Accounts receivable...
-
An object is moving along a vector represented as Calculate: r(t) = (2)i + (cos 2t)j + (sin 2t)k where t > 0. i. the curvature, x, for r(t). ii. the radius of curvature, p, for r(t).
-
How does immunity affect liability?Should there be absolute immunity for government employees?Should parent-child immunity be abolished in all states?Why or why not?
-
Create a new MIPS program that will ask a user to enter a number repeatedly. This program will calculate 2 sums: even_sum (sum of all even numbers) and odd_sum (sum of all odd numbers). The program...
-
3. Consider a 1-D ideal sampling function defined as +oo Sideal(x, Ax) = 5(x-n.Ax) 112=-00 = {(x-n. 2.Ax) 0 and a 1-D rectangular input signal: f(x) = RECT(). (f) If the sampled function is f(x) =...
-
Venture capital is funding provided by a group of professional investors for use in a well-established, longstanding business enterprise ?
-
Find the following. 2. 3 y(t) + 3y(t) 3+ = x(t) + 3 x(t) 3. y(t) - 1/2 y(t) x(t) = dt d 4. dt d 5. dt y(t) + 1/2 y(t) + y(t) y(t) + 1/2 y(t) = x(t) + x(t) = x(t)
-
Question 1: Consider the following scenario. I have in my possession an o-sided die and my friend has an m- sided die. We would like to determine if o = m (our hypothesis). We have decided to perform...
-
Draw the major product for each of the following reactions: (a) (b) (c) 1) 9-BBN 2) H2O2, NaOH 1) Disiamylborane 2) H20, NaOH
-
Consider the following data: a. Construct a frequency distribution. b. Construct a histogram. c. Construct a stem-and-leaf display. 7769 3355 15 24 35 36 44 44 64 2 5 99092 123345
-
A conference began at noon with two parallel sessions. The session on portfolio management was attended by 40% of the delegates, while the session on chartism was attended by 50%. The evening session...
-
A random sample of companies was surveyed and asked to indicate if they had used an Internet career service site to search for prospective employees. The companies were also asked questions...
-
A periodic torque with a maximum value of \(1.0 \mathrm{~N}-\mathrm{m}\) at a frequency of \(5.0 \mathrm{rad} / \mathrm{s}\) is applied to a flywheel suspended from a wire. The flywheel has a moment...
-
A mass-spring-damper system is tested to determine the value of \(c\). Assume \(k=10 \mathrm{lb} /\) in and \(m=2\) slug. (a) If the vibrational amplitude is observed to decrease to \(33 \%\) of its...
-
A periodic force \(F(t)=A \cos \omega t\) is applied to the damped system shown in Figure 3.53. Calculate the work done in one cycle during the steady-state response where \(A=50 \mathrm{~N},...
Study smarter with the SolutionInn App