Question: C++ question ty so much. 1-1. Write a function that returns the sum of all elements in an int array. The parameters of the function
C++ question ty so much.
1-1. Write a function that returns the sum of all elements in an int array. The parameters of the function are the array and the number of elements in the array. The function should return O if the size parameter, n, is less than 1 Signature : int sum-array(int array[], int n) (Note. This program should be in the file function-1-1.cpp and the main function that call it should be in the file main-1- 1.cpp) 1-2. Write a function that returns the average of all elements in an integer array. The function takes as parameters the array and the number of elements in the array. Your function should return O.0 if the size parameter, n, is less than 1 Signature: double average(int arrayl], int n) 1-3 Write a function that returns the number of elements in an array that are equal to a given parameter. The function should take as parameters the array, its size, and the desired number. The function should return O if the size parameter, n, is less than 1. signature: int count (int arrayt], int n, int number) 1-4.Write a function that returns the sum of all of the elements of two arrays of equal size. The function should take as parameters an array, another array and their size. The function should return 0 if the size parameter, n, is less than 1. signature: int sumtwo(int array, int secondarray[], int n) 1-5 Using a for loop, count the number of even numbers between 1 and a number we supply (inclusive). Return O if the parameter is less than 1. signature: int count_even(int number)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
