Programming with Parallel Arrays exercises

Given the following declarations:

#define kMax 100 /* maximum number of students */
int Passing[kMax+1];  /* who passed */
int Score[kMax+1];    /* their scores  */
int grade;

Assume elements 1 to 100 of array Score contain scores for 100 students.

  1. Write a code segment that initializes all students in Passing to false (zero).

  2.  


  3. Write a code segment that sets the students in Passing to true (one) wherever the parallel value of Score is greater than 60.



  4.  
  5. Write a code segment that prints the index of the of items in Passing that are true (one).




  6. Write a function that is passed Passing as a parameter and returns the count of the number of items in Passing that are true (one).







  7. Write a function that is passed Score and grade as parameters and returns the count of the number of items in Score that are greater than grade.






  8.  
  9. Turn the code segment in problem 2 into a function that is passed the two arrays and an integer criterion value.

  10.