# Write a recursive function that takes a string as input. This recursive function should open a...

###### Question:

Write a recursive function that takes a string as input. This recursive function should open a file by the name of the string, and read the first word. Then attempt to open a file by the word you just read and repeat this process. This ends, when there is no file with the name you are looking for. At this point, cout the last word in the current file (the one where the first word was not a different file).

So for example if you have three files: "hi.txt" contains: moo is happy cow "moo" contains: im actually a sad cow "cow" contains: the cow is a lie

If you ran this recursive function on "hi.txt", you would find the first word in this file is "moo". "moo" is an actual file, so we open it. The first word in "moo" is "im". There is no file "im", so we would just cout "cow". (Ensure you do not write the function for this specific example... but any combinations of files and words.)

#### Similar Solved Questions

d ancial statement information and additional data for Stanislaus Co. is holow Prepare a statement of cash flows for the year ending December 31, 2018 December 31 2018 w $65,000 144 200 206,600 21,000 2017$42.000 84,000 168,000 58,800 504.000 $856.800$84,000 50,400 Cash Accounts receivable (net) I...
The tolowing data relating to units shipped and total shipping expense have been assembled by Archer Company, a wholesaler of large, custom-built air-conditloning units for commercial buildings Total Units Month Shipped January Februay March Apri May June July 1,900 $2.400 1,800$2,100 $2.400$3,400...