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
  • 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...

  • 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

  • In C++: You are to write two functions, printString() and testString(), which are called from the...

    In C++: You are to write two functions, printString() and testString(), which are called from the main function. printString (string) prints every character in the string to std::cout with a space after every character and a newline at the end. testString (string) returns true if the string contains characters that are in sorted order, false otherwise. You may assume that all characters are lowercase and only alphabetical characters are present. See the main() to see how the two functions are...

  • 10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string...

    10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search string for all occurrences of string2. When it finds an occurrence of Programming Challenges string2, it should replace it with string. For example, suppose the three arguments have the following values: stringt: "the dog jumped over the fence" string 2 "the" string3: "that" With these three arguments, the function would return a...

  • write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy....

    write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy. The function should be passed 2 parameters, as illustrated in the prototype below. int pow_xy(int *xptr, int y); Assuming that xptr contains the address of variable x, pow_xy should compute x to the y power, and store the result as the new value of x. The function should also return the result. Do not use the built-in C function pow. For the remaining problems,...

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
ADVERTISEMENT