Rewrite the function body of this function so that instead of using iterating through the elements of the parallel arrays

LANGUAGE: C++

CHALLENGE:

consider the testPIN function used in Program 7-21. For convenience, we have reproduced the code for you below.

Rewrite the function body of this function so that instead of using iterating through the elements of the parallel arrays, it returns true or false by calling countMatches the function defined in the previous exercise (10988), and checking its return value.

SOLUTION:

bool testPIN(int custPIN[], int databasePIN[], int size) 
{ 
    int count; 
    count=countMatches(custPIN,databasePIN,size); 
    if(count==size) return true; 
    else return false; 
}