Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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