Question: This is a multipart question. Please answer all parts. Using Erlang (in any text editor) please with the following functions 1. Function removeDiv3that takes a

This is a multipart question. Please answer all parts.

Using Erlang (in any text editor) please with the following functions

1. Function removeDiv3that takes a list of numbers and returns the original list with all values divisible by 3 removed, e.g. if the original list contains [0, 1, 2, -3, 6], then [1, 2]is returned; you are NOT allowed to use built-in functions or list comprehension; add appropriate test cases to the test file that use true matching pattern(i.e. the other method that does NOT use assertEqual)

2. Function calculateBillthat takes a list of tuples, where a tuple is of the form name, price, tax_rate, and returns a list of tuples, where each tuple is of the form name, total,wheretotal = price + price * tax_amountadd appropriate test cases to the test file.

3. Functiongeneratetakes threeints as arguments and generates a list of integers from arg1 to arg2 (inclusive)in increments indicated by arg3, e .g. if arg1 = 3,arg2 = 8,and arg 3 = 2,then the function returns [3, 5, 7]. If arg1 > arg2, returns an empty list; assume arg3 will be a valid number; you are NOT allowed to use built-in functionsor list comprehension;add appropriate test cases to the test file

4. Function getnththat takes a list and an int n and returns the nth element of the list, where the head of the list is the 1st element. You are only allowed to use list functions hd and tl in your solution no other built-in functions are allowed. If the list is empty orn is invalid, return a tuple: {error, no_such_element}add the following test cases to the test file:getnth_1_test() -> {error, no_such_element} = lab05:getnth([], 2).getnth_2_test() -> {error, no_such_element} = lab05:getnth(["hello", "there"], 3).getnth_3_test() -> {error, no_such_element} = lab05:getnth(["hello", "there"], 0).getnth_4_test() -> "there" = lab05:getnth(["hello", "there"], 2).getnth_5_test() -> "there" = lab05:getnth(["hello", "there", "where"], 2).getnth_6_test() -> "where" = lab05:getnth(["hello", "there", "where"], 3).getnth_7_test() -> "where" = lab05:getnth(["hello", "there","where", "here"], 3).

5. Functionrepeatthattakes a list of integers and a list of nonnegative integers and returns a list that repeats the integers in the first list according to the numbers indicated by the second list; add the followingtest cases to the test file these test files also illustrate the logic of repetition to be followedrepeat_1_test() ->[2, 2, 2, 2, 3] = lab05:repeat([1, 2, 3], [0, 4, 1]).repeat_2_test() ->[] = lab05:repeat([], [0, 4, 1]).repeat_3_test() ->[] = lab05:repeat([1, 2, 3], []).repeat_4_test() ->[4,4] = lab05:repeat([4,5,6], [2]).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!