Write a function that accepts an array and a value

Assignment Help Programming Languages
Reference no: EM132268435

Introduction

It's time to put all your JavaScript skills to the test to build an app combining everything you've learned about JavaScript so far. In this assignment, you are required to build 10 functions.

Goals and Outcomes

• Reverse engineering functions found in JavaScript with the intention of defining them yourself
• Write decision-making statements and control structures to solve problems
• Apply programming logic to solve basic to intermediate problems
• Testing and debugging

Description

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 are creating might be very similar to a built-in function found predefined in the JavaScript language.

Each function needs to be considered as an individual problem. Focus on each function one problem at a time until all 10 functions are defined.

There are two versions of the assignment. The last two digits of your student id determine the set of steps you must implement. Check the what to implement section of this document for more details.

What to implement?

• Create only one JavaScript file which must be called STUDENT_ID- functions.js.
• All the functions you implement must be placed in STUDENT_ID- functions.js and you are not allowed to use any external file or library. Using an extra file or library will produce a zero mark for your assignment.
• Based on the last two digits of your student id, you are required to implement the following functions

1. Write a function that returns a string containing random characters where the length must be equal to the value of the parameter.

2. Write a function which returns the calling string value converted to upper case.

3. Write a function which adds the equal amount (numSpace) of whitespace (numSpace) to both ends of the receiving string.

4. Write a function to change the case of all the characters in the string (str) parameter to its opposite case (upper / lower) when the character position matches the value of the pos parameter.

5. Write a function to return the reversed version of the string it receives as an argument.

6. Write a function which combines two strings which are passed as parameters. Mix one character from each string and return the concatenated result.

7. The trimLeft() method removes whitespace from the left end of a string.

8. Write a function which removes whitespace from both ends of the receiving string.

9. Write a function to concatenate 2 arrays and return a new array.

10. Write a function that accepts an array and a value. Check every element of the given array against a given value. Return true if the array elements are bigger than the provided value.

Do not use function

You are not allowed to use any of the built-in functions listed in the Do not use function section of this document. Using any of the following functions will result in zero marks for your assignment.

String built-in functions

Array built-in functions

endsWith()

concat()

includes()

copyWithin()

indexOf()

every()

lastIndexOf()

fill()

localeCompare()

filter()

match()

find()

repeat()

findIndex()

replace()

forEach()

search()

indexOf()

slice()

isArray()

split()

join()

startsWith()

lastIndexOf()

substr()

map()

substring()

pop()

toLocaleLowerCase()

push()

toLocaleUpperCase()

reduce()

toLowerCase()

reduceRight()

toString()

reverse()

toUpperCase()

shift()

trim()

slice()

 

some()

 

sort()

splice()

toString()

unshift()

valueOf()

Verified Expert

It is a javascript assignment where we have to do ten methods of javascript as per requirements sent by the student. We are not using any javascript provided methods here and everything is been implemented by us on our own.

Reference no: EM132268435

Questions Cloud

How does group size influence synergy : Under what conditions do a) groups outperform individuals, and b) individuals outperform groups? How does this relate to team building?
Discuss the definition of politics : Can you think of examples from your everyday life when you encounter politics? What makes these experiences "political"?
Detail the four phases of group development : Detail the four phases of group development and the five factors that go into building group cohesiveness.
Read statement and give reason in brief : Do you think the same person who receives cash payments should also prepare the bank reconciliation? Give at least one reason to support your answer.
Write a function that accepts an array and a value : Write a function that returns a string containing random characters where the length must be equal to the value of the parameter
How does group cohesion relate to influence : How does group cohesion relate to influence/conformity. What did the variations in the Asch experiments reveal about why people conform?
Is it possible to study politics objectively : Is it possible to study politics objectively, or will our own personal political views always shape the way we study politics?
Discuss sumner ideal types of the in-group and out-group : Discuss Sumner's ideal types of the in-group and out-group. How does this relate to the interconnection of the task and social dimensions of groups?
Explain how gender differences in communication patterns : Explain how gender differences in communication patterns might link to a) differences in communication by status

Reviews

inf2268435

8/31/2019 2:01:44 AM

javascript is external I attached here with html file I just checked my code number 1,3,5 and 9 shows no error. So let the expert review the 2,4,6,7,8,10. 32972476_1COMP1231 Assignment winter 2019.pdf

len2268435

3/28/2019 2:33:11 AM

There are 10 short question.I tried to complete 8 of them and couldn't find solution for 2 questions.Also need to review the other 8 questions if there are are any mistakes. Because 2 of them resulted error.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd