Results 1 to 5 of 5

Thread: help plz ....hard home work

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    4

    help plz ....hard home work

    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

    Suzan

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    4
    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 .

    thanks a lot

  4. #4
    Lively Member
    Join Date
    Nov 2001
    Posts
    71

    where are you guys!
    she need a code !

    Suzan, don't warry we usually say this in my language:
    ma3endik a7ad!
    Last edited by VB-Sultan; Feb 20th, 2002 at 09:21 AM.
    ¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸

    (¯`·.¸¸.·´(¯`·.¸l VB-Sultan l¸.·´¯)`·.¸¸.·´¯)

    `·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Here are the pure C solutions for your problem, maybe you can derive C++ code from it. My C++ code doesn't work correctly, so I can't post it.
    Attached Files Attached Files
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width