hi guys
im happy to help but its easier for me if you give me a url to the assignment/question.
for this one, just be patient and read the question a few times untill you fully understand what its saying. none of the questions are that hard once you realise what you need to do. if your doing a comp degree, get used to these confusing specs, if you dont understand what is required, mail your lecturer. i usually send a few mails to my lecturer for each assignment, just to make sure i understand things correctly. as longs as you ask nicely and dont say stupid shit they will respond.
the four questions all can be solved in a similar way. the way you want to do them is in your function create an array that will store you results. For eg say we have an array of 10 integers, and we want to find the sum of all the integers in the array, excluding the item at the current position in the array.
<pre>
#include <iostream>
void
jiggy(int F, int L, int arr[])
{
int i, j, results[L];
for (i = F; i < L; i++) { //for every element in the input array
results = 0; //set initial sum to 0
for (j = F; j < L; j++) { //sum up all the other elements
if (j == i)
continue; //skip this element
results = results + arr[j];
}
}
for (i = F; i < L; i++)
cout << "skipping element " << i << ": " << results << endl;
}
int
main(void)
{
int i, arr[10];
for (i = 0; i < 10; i++)
arr = i;
jiggy(0, 10, arr);
return(0);
}
</pre>