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) { }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C++

This is the given code:

#include <vector>
#include <iostream>
#include <algorithm>

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 <string> &discovered, int numRows, int numWords);

// Printer function that outputs a vector
void printVector(const vector <string> &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 <string> 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 <string> &discovered, int numRows, int numWords)
{

}

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

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY