Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

In this assignment, you are going to create a JavaScript file containing 10 functions. Each function represents one step, and 10 marks are assigned to each step (function). The functions you create...

1 answer below »
In this assignment, you are going to create a JavaScript file containing 10 functions. Each function represents one step, and 10 marks are assigned to each step (function). The functions you create might be very simpler to a built-in JavaScript function. Each function needs to be considered as an individual problem, and you just focus on that one problem when you code the function. What to implement? • Create only one JavaScript file• All the functions you implement must be placed in that JavaScript file, and you are not allowed to use any other external file or library. •
Answered Same Day Mar 19, 2021

Solution

Suraj Prakash answered on Mar 25 2021
156 Votes
function stringLength(s)
{
    var len = 0;
    while(s[len]!== undefined)
        {
            len++;
        }
    return len;
}
function toLowerCaseString(s)
{
    var i = 0;
    var lowerCase = "";
    while(s[i]!== undefined)
    {
        if(s.charCodeAt(i)>=65 && s.charCodeAt(i)<=90)
            {
                lowerCase += String.fromCharCode(s.charCodeAt(i) + 32);
            }
        else    
            lowerCase += s[i];
        i++;
    }
    return lowerCase;
}
function reverseString(s)
{
    var i = stringLength(s) - 1;
    var str = "";
    while(i!==-1)
    {
        str += s[i];
        i--
    }
    return str;
}
function sumOfA
ay(a
)
{
    var i = 0, sum = 0;
    while(a
[i])
    {
        if(isNaN(a
[i]))
        {
            i++;
            continue;
        }
        else
        {
            sum += a
[i];
            i++;
        }
    }
    return sum;
}
function removeCharFromString(str, ch)
{
    var i = 0;
    var output = "";
    var len = stringLength(str);
    while(str[i]!== undefined)
    {
        if(str[i] == ch)
        {
            i++;
            continue;
        }
        else
        {
            output += str[i];
            i++;
        }
    }
    return...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here