help please begginer in cs 246, im having a hard time. needed asap. thank you


a) Write a void function called make_it_sequence that takes two parameters: an an array of int values and an int value indicating the size of the array. The function fills the array with the numbers 1 through n, where n is the size of the array.

b) Write an int function called average that takes two parameters: an an array of int values and an int value that indicates the size of the array. The function calculates and returns the average of all the values in the array. Make sure that this function is not allowed to modify the array.

c) Finally, write a program that:

1. allocates a dynamic array of N integers. Your program must ask the user for the value of N.

2. calls the make_it_sequence function to have the array filled with the numbers 1 through N - 1.

3. displays the contents of the array to screen. The elements should be printed on a single line, separated by spaces.

4. displays the average of all the values in the array (using the average function)
Well, you better start coding. Noone is going to stop what they are doing just to give you answers for free. We have a life, just like you do. Once you do your work, then post it and we may be able to help you by guiding you to the right direction.

Take a look at this, it could help you out with what you are asking for:

http://www.cplusplus.com/forum/articles/40071/

hope for soon code!
A few basic constructs you may need:

The 'for' loop to fill array and iterate through array
1
2
3
4
for (int i = 0; i < N; i++)
{
    ...
}


Possible function prototype
1
2
3
4
void make_it_sequence(int *array, int count)
{
    ...
}

Topic archived. No new replies allowed.