Question: (c++) PartA.cpp : The Poem You are given a copy of the poem The Raven in poem.txt (included at bottom). The copy is in a

(c++) PartA.cpp : The Poem 
You are given a copy of the poem "The Raven" in poem.txt (included at bottom). The copy is in a text file containing only one line. Open this file and read the data into a string. Write a template function to extract sub-strings of the poem string and store them into a string array. The function should ignore whitespace characters (space, tab, newline) but allow for use of a delimiter list to extract sub-strings. 
Use the delimiters ; -- , . to parse the poem string into sub-strings and store into a string array. Output each sub-string, one line at a time to a file named ravenPhrases.txt Sample output of ravenPhrases.txt: Once upon a midnight dreary While I pondered Weak and weary  PartB.cpp : Raven Poem Sorted Modify the program to sort the sub-strings in the string array. Output this sorted list to a filenamed ravenListSorted.txt Notes: 1. The file raven.txt is a one line string containing the complete poem. (at bottom) 2. You may use any of the C++ STL functions to complete this lab 3. Upload your raven.cpp ravenPhrases.txt and ravenListSorted.txt 4. The template function should be general purpose, allowing for a different set of delimiters or type of data to be specified. 

poem.txt

Once upon a midnight dreary, while I pondered, weak and weary, Over many a quaint and curious volume of forgotten lore-- While I nodded, nearly napping, suddenly there came a tapping, As of some one gently rapping, rapping at my chamber door. Tis some visitor, I muttered, tapping at my chamber door-- Only this and nothing more. Ah, distinctly I remember it was in the bleak December; And each separate dying ember wrought its ghost upon the floor.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!