Question: In C++ right the simplest version of code. Have comments. The code starts by displaying the saved advice from the file lab7.txt The following person

In C++ right the simplest version of code. Have comments. The code starts by displaying the saved advice from the file lab7.txt The following person to run the program receives the advice from only the person who last ran the program. The advice is kept in a lab7.txt and the contents of the file change after each run of the program. Allow the user to type in the advice of any length so that it can be any number of lines long. The user is told to end his or her advice by pressing the Return key two times. Your program can then test to see that it has reached the end of the input by checking to see when it reads two consecutive occurrences of the character . HINTS You need to look at each character as it is read to see if it is . So you need to use cin.get() . And you should then use out.put() to match, where out is a stream connected to the file. Be sure to open the file as an ifstream, read it and print it to the display, then close it; then reopen the same file as an ofstream so you can write the new advice to the same file.

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!