Write a c++ program that ask the user for a file with a letter matrix and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a c++ program that ask the user for a file with a letter matrix and a word to find in that matrix. The matrix file, the first line of the file is the number of rows and second line is the number of columns. When looking for a word in the matrix it should be case insensitive. Your program should then find a continuous path thought the matrix that spells the word. Your program should only move left (col -1), right (col +1), up (row -1) and down (row+1). If there is such a path in the matrix, that path should be printed to console, using 'V' for down, 'N' for up,'' for right, '<' for left, *' where the path ends and for all other positions in the matrix. and write it so it will use a stack and no recursion. You must write your own templated stack class that is implemented using a linked list. Your stack must have a peek, pop, push and isEmpty function. Your solution should not have any recursion. Examples 1 Name of the file with the matrix TestFile.txt PEH W V Z LLOB VLP V H HWQDO What word are you looking for hello 11 Example 2 Name of the file with the matrix TestFile.txt E H W V L L O B P Z V L P V H H W Q D O What word are you looking for beans No path found Write a c++ program that ask the user for a file with a letter matrix and a word to find in that matrix. The matrix file, the first line of the file is the number of rows and second line is the number of columns. When looking for a word in the matrix it should be case insensitive. Your program should then find a continuous path thought the matrix that spells the word. Your program should only move left (col -1), right (col +1), up (row -1) and down (row+1). If there is such a path in the matrix, that path should be printed to console, using 'V' for down, 'N' for up, '>' for right, '<' for left, *' where the path ends and for all other positions in the matrix. and write it so it will use a stack and no recursion. You must write your own templated stack class that is implemented using a linked list. Your stack must have a peek, pop, push and isEmpty function. Your solution should not have any recursion. Examples 1 Name of the file with the matrix TestFile.txt PEH W V Z LLOB VLP V H HWQDO What word are you looking for hello 11 Example 2 Name of the file with the matrix TestFile.txt E H W V L L O B P Z V L P V H H W Q D O What word are you looking for beans No path found Write a c++ program that ask the user for a file with a letter matrix and a word to find in that matrix. The matrix file, the first line of the file is the number of rows and second line is the number of columns. When looking for a word in the matrix it should be case insensitive. Your program should then find a continuous path thought the matrix that spells the word. Your program should only move left (col -1), right (col +1), up (row -1) and down (row+1). If there is such a path in the matrix, that path should be printed to console, using 'V' for down, 'N' for up,'' for right, '<' for left, *' where the path ends and for all other positions in the matrix. and write it so it will use a stack and no recursion. You must write your own templated stack class that is implemented using a linked list. Your stack must have a peek, pop, push and isEmpty function. Your solution should not have any recursion. Examples 1 Name of the file with the matrix TestFile.txt PEH W V Z LLOB VLP V H HWQDO What word are you looking for hello 11 Example 2 Name of the file with the matrix TestFile.txt E H W V L L O B P Z V L P V H H W Q D O What word are you looking for beans No path found Write a c++ program that ask the user for a file with a letter matrix and a word to find in that matrix. The matrix file, the first line of the file is the number of rows and second line is the number of columns. When looking for a word in the matrix it should be case insensitive. Your program should then find a continuous path thought the matrix that spells the word. Your program should only move left (col -1), right (col +1), up (row -1) and down (row+1). If there is such a path in the matrix, that path should be printed to console, using 'V' for down, 'N' for up, '>' for right, '<' for left, *' where the path ends and for all other positions in the matrix. and write it so it will use a stack and no recursion. You must write your own templated stack class that is implemented using a linked list. Your stack must have a peek, pop, push and isEmpty function. Your solution should not have any recursion. Examples 1 Name of the file with the matrix TestFile.txt PEH W V Z LLOB VLP V H HWQDO What word are you looking for hello 11 Example 2 Name of the file with the matrix TestFile.txt E H W V L L O B P Z V L P V H H W Q D O What word are you looking for beans No path found
Expert Answer:
Answer rating: 100% (QA)
include include include template class Stack private struct Node T data Node next NodeT val dataval ... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Garden Sales, Incorporated, sells garden supplies. Management is planning its cash needs for the second quarter. The company usually has to borrow money during this quarter to support peak sales of...
-
The costs per equivalent unit of direct materials and conversion in the Rolling Department of Jabari Steel Company are $1.00 and $2.15, respectively. The equivalent units to be assigned costs are as...
-
1. Insert a module and create a subroutine named Receipt(). Excel 2. Place a button with the name "Generate Receipt" that would link to this subroutine when clicked. Do the following parts from 3 to...
-
Scofield Company has the following information for March: Sales ....................$240,000 Variable cost of goods sold ........... 86,400 Fixed manufacturing costs ............ 57,600 Variable...
-
You want to create a portfolio equally as risky as the market, and you have $1,000,000 to invest. Given this information, fill in the rest of the following table: Asset Investment Beta Stock...
-
Why is detection risk for verifying cash balances invariably low? Why does the auditor not often use analytical procedures for the audit of cash balances?
-
What does a low-risk premium indicate?
-
Derive cash disbursements for dividends Johnson & Johnson, a pharmaceutical and medical products company, reported a balance in retained earnings of $26,571 million at the beginning of the year and...
-
Cullumber Company is considering three long-term capital investment proposals. Each investment has a useful life of 5 years. Relevant data on each project are as follows. Project Bono Project Edge...
-
Schank Marketing Research has just signed contracts to conduct studies for four clients. At present, three project managers are free for assignment to the tasks. Although all are capable of handling...
-
dataset.age 25- RR Graphics: Device 2 (ACTIVE) 100- 75- 50 missing Missing Not Missing Non-binary man woman dataset.gender M- NA X
-
Accepting an engagement to examine an entity's financial projection most likely would be appropriate if the projection were to be distributed to a. All employees who work for the entity. b. Potential...
-
When an accountant examines a financial forecast that fails to disclose several significant assumptions used to prepare the forecast, the accountant should describe the assumptions in the...
-
What body establishes standards for a. All audits and for reviews of interim financial information and preparation of unaudited financial statements of public companies? b. Reviews and compilations...
-
An examination of a financial forecast is a professional service that involves a. Compiling or assembling a financial forecast that is based on management's assumptions. b. Limiting the distribution...
-
The objective of a review of interim financial information of a public entity is to provide an accountant with a basis for reporting whether a. Material modifications should be made to conform with...
-
R6. Question 5 2.5 pts Consider a put option to sell Kraft Heinz Corporation common stock at a strike price of K = $31.50 If the stock price is $30.40, the call is: O over-the-money O in-the-money ...
-
Suppose the index goes to 18 percent in year 5. What is the effective cost of the unrestricted ARM?
-
Write the following method that shuffles the elements in an ArrayList of integers. public static void shuffle(ArrayList list)
-
Write a program that prompts the user to enter two strings and displays the largest common prefix of the two strings. Here are some sample runs: Enter the first string: Welcome to C++ Enter the...
-
Write a program that prompts the user to enter the number of students and each students name and score, and finally displays the student with the highest score and the student with the second-highest...
-
Chelsea Fabricating applies variable overhead to products on the basis of standard direct labor hours. Presented is selected information for last month when 10,000 units were produced. Required Solve...
-
Presented are partial flexible cost budgets for various levels of output. Required Solve for items a though n. Direct materials Direct labor.. Variable overhead.. Fixed overhead.. Total Rate per unit...
-
Petra Company uses standard costs for cost control and internal reporting. Fixed costs are budgeted at \($36,000\) per month at a normal operating level of 10,000 units of production output. During...
Study smarter with the SolutionInn App