Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

You are required to make a class of WordPuzzle, which is basically a game of finding words inside a 2d-array of characters. The class needs to take rows and columns as arguments and allocate a character array of required dimensions. The character array is then to be filled with the 2d-array provided in the input file.

The class should also contain findWord function, which should take a word and check if the word appears HORIZONTALLY or VERTICALLY in the array. The starting position of the word should be returned by a call to a separate function get Position. Following is a simple class definition for you to start with.

class WordPuzzle{
public:
// constructor - also initializes array with random characters
WordPuzzle (int rows, int cols);
// find the specified word in the 2d-array
bool findWord (char *word);
// gets the position of the word last found
bool getPosition (int& row, int& col , char& dir);
private:
// whatever you need
}

Input/ Output Requirements: There is one input file for this problem, which contains dimension (row, col) in the first line. The second line contains the given 2dArray of characters. This will be followed a list of words line by line. The output file contains the word, position and direction line by line as in the input file.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9528292

Have any Question?


Related Questions in Computer Engineering

Please help with anbspfunctionnbspcodesymbol to convert

Please help with a function  codeSymbol , to convert each mark to a symbol (A, B, C, D, E, F) and a code (7,6,5,4,3,2,1) according to the table below. And call it in the main function. Use the table below to determine th ...

When a source operand is ambiguous such as a value defined

When a source operand is ambiguous, such as a value defined as CR EQU 0DH, which can be either a 16 bit value or an 8 bit value, how can the ambiguity be removed. This is typical of an error staring "Is it byte or word?" ...

Taskwrite an essay according to the following

Task Write an essay according to the following instructions. Your lecturer will provide few links for relevant articles and/or case studies. These will be available to you just after your second assignment submission dat ...

We can represent numbers in different bases think of how

We can represent numbers in different bases. Think of how you could represent the number 5 in base 2. Essentially, how can you break the number 5 into powers of 2. It contains one 4 and one 1. In base 2, your digit overf ...

Stepscreate a java project in eclipse called lab 2 next

Steps: Create a Java project in Eclipse, called Lab 2. Next create a java class called Dashboard. It should extend javafx.application.Application. This will be the main GUI for your lab, and it should use a VBox as the r ...

A student raises her hand in class and states i can legally

A student raises her hand in class and states, "I can legally copy any DVD I get from Netflix because Netflix purchased the DVD and the copyright only applies to the company who purchased the product." Explain whether th ...

Algorithms assignment -task -1 design and implement an

Algorithms Assignment - TASK - 1. Design and implement an efficient algorithm for determining the best route between two given stations in a given rail network. 2. The rail network should be passed to your program as an ...

Are risk-averse people more likely to order their steak

Are risk-averse people more likely to order their steak well-done? A survey was conducted that asked individuals a series of questions about risk and how the individual prefers their steak (if at all). In particular, one ...

Design a automatic room climate control system with

Design a automatic room climate control system with contextual model, state transition diagram

Question 1 why is it critical for an organization to have a

Question: 1. Why is it critical for an organization to have a DoS attack response plan well before it happens? 2. Please discuss the techniques used by malware developers to disguise their code and prevent it from being ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As