Question

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

Answer #1

double *makeDoubles(int size) { double *arr = new double[size]; for (int i = 0; i < size; ++i) { arr[i] = 0; } return arr; }

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.

(C++) Write a function called
triple that takes an array of integers as a
parameter as well as the length of the array. It should triple each
value in the array. The function should not return anything. (Note
that the contents of the array WILL be modified.)

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

Write a function in c using #include <stdio.h> that takes
a one-dimensional integer array and returns the index of the first
occurance of the smallest value in the array. Your function must be
able to process all the elements in the array. Create a function
prototype and function definition (after the main function). Your
main function should declare a 100 element integer array. Prompt
the user for the number of integers to enter and then prompt the
user for each...

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

Write a Python function that takes a list of integers as a
parameter and returns the sum of the elements in the list. Thank
you.

Write a Python function that takes a list of integers as a
parameter and returns the sum of the elements in the list. Thank
you.

Write a Python function that takes a list of integers as a
parameter and returns the sum of the elements in the list. Thank
you.

Using C++
Write a template function that accepts an integer
parameter and returns its integer square root.
The function should return -1, if the argument passed is not
integer.
Demonstrate the function with a suitable driver program .

C++ Write a function that takes in 3 arguments: a sorted array,
size of the array, and an integer number. It should return the
position where the integer value is found. In case the number does
not exist in that array it should return the index where it should
have been if it were present in this sorted array. Use pointer
notation of arrays for this question.
c++
code

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 12 minutes ago

asked 17 minutes ago

asked 17 minutes ago

asked 30 minutes ago

asked 31 minutes ago

asked 41 minutes ago

asked 41 minutes ago

asked 44 minutes ago

asked 45 minutes ago

asked 52 minutes ago

asked 53 minutes ago

asked 1 hour ago