Question

Write a function called TaylorSin.m that takes as input an array x, and positive integer N, and returns the Nth Taylor polynomial approximation of sin(x), centered at a = 0. The first line of your code should read

function s = TaylorSin(x,N)

HINT: in computing k!, use kfact = k*(k-1)*kfact since you are counting by 2

Answer #1

C programing
Write a function that takes in an integer as input and returns an
integer array of zeros.

In R- Studio : Write a function that takes as an input a
positive integer and uses the print() function to print out all the
numbers less than the input integer. (Example: for input 5, the
function should print the numbers 1,2,3,4 { for input 1, the
function should not print a number.) Write a recursive function, do
not use any of the loop commands in your code.

For C++:
a) Write a function is_prime that takes a positive integer X and
returns 1 if X is a prime number, or 1 if X is not a prime
number.
b) write a program that takes a positive integer N and prints
all prime numbers from 2 to N by calling your function is_prime
from part a.

Write a function makeDoubles in c++, that takes an integer parameter called size and:
allocates a new array of that many double's
initializes all elements to be 0
returns this array

Fill in the code for the function below called
containsAvgValue. It takes as input a
float array of any length and returns 1 if the
array happens to contain a value that equals the average of all the
values in the array or 0 otherwise. For example,
when give the array [2.0, 2.0] it should return 1 since the average
value is 2.0 and the array contains that value. To help you, I’ve
included a function that computes the average...

C Programming:
Write a function that takes in an array of integers and an
integer containing the count of elements, then have it returns the
sum of all the even values inside the array.

Define a function called ngram_list() that takes a filename and
a positive integer n representing the number of characters to be
displayed on each line (but don't actually display anything in this
function — so no print() in this function). The function should
return a list of strings, consisting of the contents of the file
split into chunks n characters long. If there is an error working
with the file, the function should return an empty list.
For example, using...

In C++ Using recursion write a program that takes a positive
integer number and returns whether there is 6. For example, if the
input number is 7068, the function returns true

Write a function that accepts an int array and the array’s size
as arguments. The function should create a copy of the array,
except that the element values should be reversed in the copy. The
function should return a pointer to the new array. Demonstrate the
function by using it in a main program that reads an integer N
(that is not more than 50) from standard input and then reads N
integers from a file named data into an...

In C programming language write a function that takes an integer
n as input and prints the following pattern on the screen:
1 (n times)
2 (n-1 times)
.n (1 time)
For example, if n was 5, the function should print
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 5 minutes ago

asked 8 minutes ago

asked 15 minutes ago

asked 17 minutes ago

asked 25 minutes ago

asked 28 minutes ago

asked 30 minutes ago

asked 36 minutes ago

asked 40 minutes ago

asked 42 minutes ago

asked 58 minutes ago

asked 1 hour ago