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...
-
Find the net force on the Moon (mM = 7.35 Ã 1022 kg) due to the gravitational attraction of both the Earth (mE = 5.98 Ã 1024 kg) and the Sun (mS = 1.99 Ã 1030 kg), assuming they...
-
Why is it important for managers to pay attention to demographic trends and shifts?
-
Suppose \(\mathbf{x} \sim M N(n, \boldsymbol{\pi})\) follows a multinomial distribution of size \(n\) and probability \(\pi\). Derive the variance matrix of \(\mathbf{x}\).
-
The Howland Carpet Company has grown rapidly during the past 5 years. Recently, its commercial bank urged the company to consider increasing its permanent financing. Its bank loan under a line of...
-
Discuss in detail some of the most common mistakes made when administering a database? Who is responsible for completing tasks needed to administer the database? What could have been done differently...
-
Harrison and Gloria have been negotiating over the sale of bulk raw materials (lumber, iron and steel). Each party has had an army of lawyers acting on both sides trying to get the deal done and it...
-
Determine the maximum load P that the column can carry if the maximum stress not to exceed 120 MPa. Solve this problem by using the Secant formula, start with Po=1000 kPa, P-2000 kPa. Manually show...
-
At steady state, a spherical interplanetary electronics laden probe having a diameter of 0.5 m transfers energy by radiation from its outer surface at a rate of 450 W. If the probe does not receive...
-
Suppose Radio Shack receives a bill with credit terms of 2/30, net 40. What is Radio Shack's effective annual interest rate (EIR) if it skips the discount and pays at the end of the total credit...
-
Provide a sample of common size financial statement and explain how these statements are useful for comparing one company to another.
-
Evaluate the different approaches used in consulting (expert approach, collaborative consulting approach, process approach, medical approach, etc.) and discuss the advantages/disadvantages of each...
-
What is a common size financial statement? Provide a sample and explain how these statements are useful for comparing one company to another.
-
William Collins is a VAT registered sole trader who uses standard quarterly VAT accounting. The following is a summary of his businesss sales and revenue expenditure for his VAT quarter ending 31 st...
-
What is removed during each of the three stages of wastewater treatment: primary, secondary, and tertiary? During which state would you expect items to be recovered that were accidentally flushed,...
-
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...
-
Explain why some employees are not comfortable being team players.
-
It is important to learn how to develop a comprehensive, clearly articulated team charter. Assume that you and your fellow students are a team in an organization (you choose the kind and size of...
-
Define effective listening .
Study smarter with the SolutionInn App