// FILE: AddArDrv.cpp // DRIVER FOR FUNCTION "add_array" #include #define SIZE 5 #include "AddArr.cpp" // Functions Used... // STORES THE SUM OF a[i] AND b[i] IN c[i] void add_array (int, // IN: the size of the three arrays const apvector &, // IN: the first array const apvector &, // IN: the second array apvector &); // OUT: result array // driver (not included in the figure) int main () { // Local Data... apvector a(SIZE); apvector b(SIZE); apvector c(SIZE); // read in array a cout << endl << "Enter " << SIZE << " numbers seperated by a space for array 1> " << endl; for (int i = 0; i < SIZE; i++) cin >> a[i]; // read in array b cout << endl << "Enter " << SIZE << " numbers seperated by a space for array 2> " << endl; for (int i = 0; i < SIZE; i++) cin >> b[i]; // do a component-wise add of a and b add_array(SIZE, a, b, c); // report results cout.setf(ios::fixed); cout << endl << "The Component-wise addition of a and b = " << endl; for (int i = 0; i < SIZE; i++) cout << c[i] << " "; return 0; }