Write a program in cpp that gives and takes advice on program writing. The program starts by writing a piece of advice to the screen and asking the user to type in a different piece of advice. The program then ends. The next person to run the program receives the advice given by the person who last ran the program. The advice is kept in a file, and the contents of the file change after each run of the program. You can use your editor to enter the initial piece of advice in the file so that the first person who runs the program receives some advice. Allow the user to type in 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 ‘\n’.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Write a program in cpp that gives and takes advice on program writing. The program starts by writing
a piece of advice to the screen and asking the user to type in a different piece of advice. The program then ends.
The next person to run the program receives the advice given by the person who last ran the program. The advice
is kept in a file, and the contents of the file change after each run of the program. You can use your editor to enter
the initial piece of advice in the file so that the first person who runs the program receives some advice. Allow the
user to type in 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 ‘\n’.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT