ww is more or less correct, even if he was brutish in how he expressed it. Unfortunately, programmers tend to be jerks, because they expect people to put a lot of effort into things, and even if you have, if they don't feel you put enough in they'll be rude.
Unfortunately, your homework is a "I've been paying attention in class" kind of homework... So it really is impossible to help much without just giving you the answers.
Remember, that to declare a variable with a value, you do something like:
int age = 12;
A pointer to 'age':
int* pointer_to_age = &age;
Print the pointer's value (which is the address of the variable 'age'):
cout << pointer_to_age;
Print the value in 'age':
cout << age;
or
cout << *pointer_to_age;
Create an array:
int primes[ 3 ] = { 2, 3, 5, 7 };
Read about functions here:
http://www.cplusplus.com/doc/tutorial/functions/
Remember that an array decomposes to a pointer at the first opportunity, so to send an array to a function you must pass both its address and its length:
int sum( int* xs, unsigned size ) { ... }
1 2
|
int xs[] = { 1, 2, 3, 4 };
cout << sum( xs, 4 ) << "\n";
|
Just keep working your way through things.
There is no simple answer here. Learning to program is a lot like learning how to ride a bicycle -- you have to keep getting on and trying. It
is hard. But it is doable.
(Another unfortunate is that programmers tend to be men, and a lot of them are fairly bigoted... Does your school have a help center?)