Again, 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.
.
.
Click on the title for the solution
.
.
bool testPIN(int custPIN[], int databasePIN[], int size)
{
if (countMatches(custPIN, databasePIN, size)== size)
return true;
else
return false;
}
.
Click on the title for the solution
.
.
This is the answer:
:
bool testPIN(int custPIN[], int databasePIN[], int size)
{
if (countMatches(custPIN, databasePIN, size)== size)
return true;
else
return false;
}
Comments
Post a Comment