hi
i am suzan, 21, female
i am new member her
i need your help with my home work
it is diffecult for me plz help me...!
============================================
(1)- Write a programe that gives and takes advice on program writing. The programe starts by writing a piece of advice to the screen and asking the user to type in a different piece of advice . The programe then ends. The next person to run the programe erceives the advice given by the person who last ran the programe. The advice is kept in a file and the contents of the file changes after each run of the programe . You can use your editor to enter the initial piece of advice in the file so that the first person that runs the programe receives some advice . Allow the user to type in advice of any lenght so that it can be any number of lines long. The user is told to end his advice by pressing the return key two times. Your programe 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'.
============================================
plzzzzzzzzzz answer it and i will told you 1000000..... of jucks lol.
thanks a lot
bye
Is this C or C++?
Here is the logical approach, I can later show you a little code (but it is still your homework )
First you need to open the file (the name is fixed, like "advice.txt"). C uses the fopen function, C++ the fstream class.
Then you read the entire content and output it (create a string buffer, read a line, output it, read next line etc. until you hit the end of the line).
Then you give the user the opportunity to enter his own advice (read a line into the string buffer, check if it is empty, if yes cancel, if no write it to file and get next line etc.).
In between you have to tell the user what to do.
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
thanks CornedBee but i want the code of this program
i am not programer . I am major in Information System and if i just pass this Course i will not take another programing course
so just help me plzz to pass this course and this is not really home work, its project and our Teacher gives 20% for these question so plzz i want pass and you are good programmer and i think its eaasy 4 you plz i want the code CornedBee .