Question: c++ Modify the following program so pin1, pin2, and pin3 are vectors instead of arrays // This program is a driver that tests a function

c++
c++ Modify the following program so pin1, pin2, and pin3 are vectors
instead of arrays // This program is a driver that tests a
function comparing the // contents of two int arrays. Hinclude using namespace
std; // Function Prototype bool testPIN(const int [], const int [], int);

Modify the following program so pin1, pin2, and pin3 are vectors instead of arrays // This program is a driver that tests a function comparing the // contents of two int arrays. Hinclude using namespace std; // Function Prototype bool testPIN(const int [], const int [], int); const int NUM_DIGITS = 7; // Number of digits in a PIN int pin1[NUM_DIGITS ]={2,4,1,8,7,9,0};// Base set of values. int pin2[NUM_DIGITS] ={2,4,6,8,7,9,0};// Only 1 element is // different from pin1. int pin3[NUM_DIGITS ]={1,2,3,4,5,6,7};// All elements are // different from pin1. if (testPIN(pin1, pin2, NUM_DIGITS)) cout "ERROR: pin1 and pin2 report to be the same. In"; else cout "SUCCESS: pin1 and pin2 are different. In"; if (testPIN(pin1, pin3, NUM_DiGITS)) cout "ERROR: pin1 and pin3 report to be the same. nn"; else cout "SUCCESS: pint and pin3 are different.1n": if (testPIN(pin1, pin1, NUM_DiGITS)) cout "SUCCESS: pin1 and pin1 report to be the same. In": cout "ERROR: pin1 and pin1 report to be different. In"; return 0 // The following function accepts two int arrays. The arrays are // compared. If they contain the same values, true is returned. // If the contain different values, false is returned. 1/ bool testPIN(const int custPIN[], const int databasePIN[I, int size) // The following function accepts two int arrays. The arrays are // compared. If they contain the same values, true is returned. // If the contain different values, false is returned. bool testPIN(const int custPIN[], const int databasePIN[], int size) \{ for (int index =0; index

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!