Question

Note: Please test your output on the console and also avoid the functions below.

6. Write a function which combines two strings which are passed as 7. The trimLeft) method removes whitespace from the left eDo not use function You are not allowed to use any of the built-in functions listed in the Do not use function section of thi


6. Write a function which combines two strings which are passed as 7. The trimLeft) method removes whitespace from the left end of a 8. Write a function which removes whitespace from both ends of the parameters. Mix one character from each string and return the concatenated result. function('ABC','Defg) return ADBeCfg string. Whitespace in this context is all the whitespace characters (spaces, tabs, and newlines.) function("t value") l/return "value" receiving string. Whitespace in this context is all the whitespace characters (spaces, tabs, and newlines.) function(" valuelt") //return "value" 9. Write a function to concatenate 2 arrays and return a new array. //function ([1,2],[3,4]) l/return [1,2,3,4], (Note: same functionality as Array.concat ) 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. // function( [5,10], 5) /I false II function([6,10],5) // true', (Note: similar functionality as Array.every)
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 String built-in functions endsWith) includes ) indexOf () lastIndexof ) LocaleCompare() match () repeat () replace () search () slice() split () startswith() substr() substring () toLocaleLowerCase ) toLocaleUpperCase () toLowerCase ) toString () toUpperCase () trim() valueOf trimLeft and trimRight Array built-in functions concat) copyWithin) every () fill () filter() find ) findindex () forEach () indexof ) İsArray() join) lastIndexof ) map() pop () push () reduce() reduceRight () reverse ) shift () slice () some ) sort () splice) tostring () unshift) valueof ) Submission deadline and rules Due date: Must be posted on your GBleam account by Week 12: Satuiday, Maich 31, 2019 11:59 Late submission-20% per day Must use the Assignment tester before the assignment due date. Assignment tester will be teleased a week before chie date. -
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Add a comment
Know the answer?
Add Answer to:
6. Write a function which combines two strings which are passed as 7. The trimLeft) method remove...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JavaScript 1. Write a function which receives one argument (string) and converts the string to uppercase....

    JavaScript 1. Write a function which receives one argument (string) and converts the string to uppercase. function('abc') // returns 'ABC' 2. Write a function that accepts an array and a value. Find and return the first array element with bigger than given value. function([5,15,4],6) //returns 15 DO NOT USE THESE IN-BUILT FUNCTIONS BELOW endsWith() includes() indexOf() lastIndexOf() localeCompare() match() repeat() replace() search() slice() split() startsWith() substr() substring() toLocaleLowerCase() toLocaleUpperCase() toLowerCase() toString() toUpperCase() trim() valueOf() trimLeft and trimRight unshift() valueOf() includes()...

  • Code the following function in JAVASCRIPT (Use of the given list of inbuilt functions is not...

    Code the following function in JAVASCRIPT (Use of the given list of inbuilt functions is not allowed) Write a function that searches the string (passed as first argument) for the character (passed as second argument) and changes the case for all instances of that char found in string. The function should return the new string as shown in example below: function(‘abRA’, ‘a’) // returns ‘AbRa’ Assignment-2(2).pdf + х A file:///C:/Users/bhati/OneDrive/Desktop/Assignment-2(2).pdf 5 of 6 O + Fit to page IL Page...

  • CODE THE FOLLOWING FUNCTIONS IN JAVASCRIPT (USE OF THE ABOVE MENTIONED IN BUILT FUNCTIONS IS NOT...

    CODE THE FOLLOWING FUNCTIONS IN JAVASCRIPT (USE OF THE ABOVE MENTIONED IN BUILT FUNCTIONS IS NOT ALLOWED) Write a function that accepts an array as argument. The function should loop through the array elements and accumulate the sum of ASCII value of each character in element and return the total. For example: function([‘A’, ‘bc’, 12]); // returns 361 which is the sum of 65 + 98 + 99 + 49 + 50 Write a function that accepts two arguments (a...

  • Java Programming Write a function which is passed two strings. The function creates a new string...

    Java Programming Write a function which is passed two strings. The function creates a new string from two original strings by copying one character from each in turn until all characters have been copied. No use of scanner, hashmap, or exceptions please.

  • Write a recursive function called abb pattern with a single parameter astr, which is a string....

    Write a recursive function called abb pattern with a single parameter astr, which is a string. The function returns True if astr is a string of the form a nb 2n (n a-s followed by 2n b-s, where n is a positive integer) and False otherwise. For example, abb pattern("abb"), abb pattern("aabbbb"), and abb pattern("aaaabbbbbbbb") all return True, but abb pattern("") (parameter is an empty string), abb pattern("abbabb"), and abb pattern("aaabbbbb") all return False. you may not use any built-in...

  • You are to write two functions, printString() and testString(), which are called from the main function....

    You are to write two functions, printString() and testString(), which are called from the main function. printString (string) prints characters to std::cout with a space after every character and a newline at the end. testString (string) returns true if the string contains two consecutive characters that are the same, false otherwise. See the main() to see how the two functions are called. Some sample runs are given below: string: “hello” printString prints: h e l l o testString returns: true...

  • Write two (2) overloaded functions that find a string in another string (first function) and find...

    Write two (2) overloaded functions that find a string in another string (first function) and find an integer in an integer array (second function). These should be value returning functions that return: For the string find, the string value if found, “not found” if the string is not found. For the integer file, the value if found or -1 if not found. The string function will pass in a string to find and the containing string, e.g. the request could...

  • this needs to be in Java: use a comparator class which is passed into the sort...

    this needs to be in Java: use a comparator class which is passed into the sort method that is available on the ArrayList. import java.util.Scanner; public class Assign1{ public static void main(String[] args){ Scanner reader = new Scanner (System.in); MyDate todayDate = new MyDate(); int choice = 0; Library library = new Library(); while (choice != 6){ displayMainMenu(); if (reader.hasNextInt()){ choice = reader.nextInt(); switch(choice){ case 1: library.inputResource(reader, todayDate); break; case 2: System.out.println(library.resourcesOverDue(todayDate)); break; case 3: System.out.println(library.toString()); break; case 4: library.deleteResource(reader,...

  • Using swift 4.0, Write a function (not method) named findName which returns a given name (passed...

    Using swift 4.0, Write a function (not method) named findName which returns a given name (passed as a parameter) if it is in the string array passed as a parameter, otherwise return nil Demonstrate calling the function findName. Using swift 4.0

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT