Question: I need use string arrays and make this program work my typing the coding in the function outline given below. Please help. undefined The assignment
I need use string arrays and make this program work my typing the coding in the function outline given below. Please help.
undefined
The assignment is to write a C++ program codio orchid-round:-/workspaces g++ -g -Wall main.cpp -o main codio orchid-round:-/workspace$ ./main that performs 3 operations: (1) inputs words * Enter 2 integers, each in the range 1..20 from a file into an array, (2) searches an array 4 for a given word, and (3) concatenates two .. Words in A: the of to and a in is arrays together to form a single, larger array. 11 * Words in B: any new work part Here's a screenshot of how the program should behave when finished * Enter a word to search for (or . to stop>> and and' found in A @index 3 The main() function is written for you. Your and' not found in B Enter a word to search for (or . to stop) task is to write the functions corresponding to part operations (1), (2) and (3). The program starts part' not found in A part' found in 8 @ index 3 by inputting two integers from the keyboard. Enter a word to search for (or . to stop) > This controls how many words are input from pizza the files "top100.txt" and "next100.txt" input pizza' not found in A pizza not found in B files (these are the top 200 most commonly Enter a word to search for (or . to stop) > used English words). These words are then stored into two dynamically-allocated arrays .. Words in A@B: the of to and a in is any new work part (step #1). A search loop allows these arrays to be searched (step #2). Finally, the two arrays are concatenated together into a single array, which is then output (step #3). void fill(string filename, string A[], int N) [...] 11 1/ search / 1/ Searches A for the given value. If found, 1/ function returns the index of the first -1 occurrence; if not found, -1 is returned. 11 int search(string A[], int N, string value) (...) 11 11 concatenate 1/ Given two arrays A and B of sizes NA and NB, respectively, 1/ the function dynamically allocates a new array of size NA+NB 1/ and copies the contents of A into this new array followed by 11 the contents of B. The pointer to this new array is returned. 1/ The function assumes that NA > O and NB > 0, although NA and 1/ NB can be different sizes. 1/ -/ Example: suppose 1/ A contains "pizza", "apple" with NA = 2 1/ B contains "banana" with NB = 1 1/ The functions returns the pointer to a dynamically-allocated 1/ array of size 3 containing the values "pizza", "apple", "banana" string* concatenate(string A[], int NA, string B[], int NB) [
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
