CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2015
    Posts
    1

    I need programming help quick!

    Hi everyone. This assignment has really thrown me for a loop. Could someone help me with this code, and perhaps have it done my 1:30 today? I realize this is short notice and no one is obligated to help me, but it would be much appreciated.

    "Write a program which displays the following menu and then prompts the user to enter a menu choice.

    1. Add Name to File
    2. Display Names on File
    3. Clear the file
    4. Exit the program.

    The Program should use ofstream and ifstream objects to write to and read from a sequential access file on disk. To add a name to the file, the program should open the file in append mode. When reading the names from the file, the program defects the end of file and the >> operator returns the false value. To clear the file, the file can be opened for output and then closed.

    The program should continue displaying the menu and executing the choices until the user selects 4 from the menu. Submit the program listing, sample printed program output and a flowchart." Please help me with the programming.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: I need programming help quick!

    You probably should have started asking for help a week ago. Good luck.

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: I need programming help quick!

    Quote Originally Posted by KitBoy View Post
    Hi everyone. This assignment has really thrown me for a loop. Could someone help me with this code, and perhaps have it done my 1:30 today? ...

    "Write a program which displays the following menu and then prompts the user to enter a menu choice.

    1. Add Name to File
    2. Display Names on File
    3. Clear the file
    4. Exit the program.

    The Program should use ...

    The program should continue displaying the menu and executing the choices until the user selects 4 from the menu. Submit the program listing, sample printed program output and a flowchart." Please help me with the programming.
    I agree with GCDEF.

    And you might also want to read this FAQ
    Victor Nijegorodov

  4. #4
    Join Date
    Mar 2001
    Posts
    2,529

    Re: I need programming help quick!

    But you won't learn this way.
    ahoodin
    To keep the plot moving, that's why.

  5. #5
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,923

    Re: I need programming help quick!

    No one here will write the program for you as that would be considered cheating. However for a few pointers have a look at http://www.cplusplus.com/reference/fstream/fstream/

    open to open the file in the required mode. http://www.cplusplus.com/reference/f.../fstream/open/
    << to insert data to the specified stream http://www.cplusplus.com/reference/o...perator%3C%3C/
    >> to extract data from the specified stream http://www.cplusplus.com/reference/i...perator%3E%3E/
    seekg() to set the input position to the beginning of the file http://www.cplusplus.com/reference/i...istream/seekg/

    A file can be cleared by opening it with the required mode.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Tags for this Thread

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

Featured