C++ This is the given code: #include #include #include using namespace std; // The puzzle will always have exactly 20 columns const int numCols = 20; // Searches the entire puzzle, but may use...


C++


This is the given code:


#include
#include
#include


using namespace std;


// The puzzle will always have exactly 20 columns
const int numCols = 20;


// Searches the entire puzzle, but may use helper functions to implement logic
void searchPuzzle(const char puzzle[][numCols], const string wordBank[],

vector &discovered, int numRows, int numWords);


// Printer function that outputs a vector
void printVector(const vector &v);


// Example of one potential helper function.
// bool searchPuzzleToTheRight(const char puzzle[][numCols], const string &word,

// int rowStart, int colStart)




int main()
{
int numRows, numWords;


// grab the array row dimension and amount of words
cin >> numRows >> numWords;


// declare a 2D array
char puzzle[numRows][numCols];


// TODO: fill the 2D array via input
// read the puzzle in from the input file using cin




// create a 1D array for wods
string wordBank[numWords];


// TODO: fill the wordBank through input using cin




// set up discovery vector
vector discovered;


// Search for Words
searchPuzzle(puzzle, wordBank, discovered, numRows, numWords);


// Sort the results
sort(discovered.begin(), discovered.end());


// Print vector of discovered words
printVector(discovered);


return 0;
}


// TODO: implement searchPuzzle and any helper functions you want
void searchPuzzle(const char puzzle[][numCols], const string wordBank[],

vector &discovered, int numRows, int numWords)
{


}


// TODO: implement printVector
void printVector(const vector &v)
{


}

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here