Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
~/$ ./a.out Letter to cross out: i How many words? 10 dry spicy spotted minute hateful magic support thick pretty frightened dry --> dry spicy --> sp*cy spotted --> spotted minute --> m*nute hateful --> hateful magic --> mag*c support --> support thick --> th*ck pretty --> pretty frightened --> fr*ghtenedI wrote part of the code for you. Declare and define the necessary functions so that the code will function correctly.
#include <iostream>
#include <string>
using namespace std;
int main() {
// receive a letter to cross out
char c;
cout << "Letter to cross out: ";
cin >> c;
// how many words to read?
int n;
cout << "How many words? ";
cin >> n;
// read the actual n words from the input
string* arrWords = new string[n];
for( int i=0; i < n; i++ )
cin >> arrWords[i];
// ***** DECLARE AND DEFINE: cloneArray
// clone the array arrWords to arrCrossout
// arrCrossout is used right below
string* arrCrossout = cloneArray(arrWords, n);
// ***** DECLARE AND DEFINE: crossOut
// Crossout!
crossOut(c, arrCrossout, n);
// Print out the results
for( int i=0; i < n; i++ )
cout << arrWords[i] << " --> " << arrCrossout[i] << endl;
return 0;
}
Turn In your source code and a screen capture of your program running on above example.