DUE BY 10/1/17 @ 8:00 PM
Write a program that reads and prints a joke and its punch line from two different files (please keep it clean). The first file contains a joke, but not its punch line. The second file has the punch line as its last line, preceded by “garbage text” (does not matter what it is). Note: the last sentence (punch line) will have a newline character before it. The program is to search for the start of the last sentence; it should NOT move backward from the file a fixed number of characters. It should work for any punch line file. The main function of your program should open the two files and then call two functions, passing each one the file it needs. The first function should read and display each line in the file it is passed (the joke file). The second function should display only the last line of the file it is passed (the punch line file). IT should find this line by seeking to the end of the file and then backing up to the beginning of the last line. Data to test your program can be found in the joke.txt and punchline.text files provided at the textbook web site.
Program must have the following functions
void displayAllLines(ifstream &infile); //Display joke
void displayLastLine(ifstream &infile); //Display punchline
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more