comprehending this question

Wondering if someone could explain this for me in further details?

For this problem you are given:
const int MAX_STUD = 100;
bool failing[MAX_STUD];
bool passing[MAX_STUD];
int score[MAX_STUD];
int length; // keeps track of how many in arrays to process.

• Complete a C++ function, named InitAry that takes ary, boolVal, and length as parameters. The function should set each component from the first component to the “length” component ( at index (length – 1) ) of ary to boolVal. You MUST USE one-and-only one for-loop.
// params: (out, in, in)
void InitAry(bool ary[], bool boolVal, int length)
{






}

• Call the function in part a., twice, once to initialize the first 75 elements of passing to true and once, to initialize the first 75 elements of failing to false.
The variables failing, passing, and length are part of some main function. You want to initialize both of them, up to index 74 (start from 0), in function InitAry. InitAry takes a bool array, already created (in main), and should fill it with either true or false. If boolVal is true, you fill with true, if boolVal is false you fill with false. In fact you fill your array with boolVal, from 0 to length-1.
So part a of the assignment is to write the InitAry function. All you need is a for loop, over the array indices "i" of ary, from 0 to length-1, and set ary[i] to boolVal.
Part b of the assignment ask you to use this function in main, and set the values required
Thank you
Topic archived. No new replies allowed.