|
-
November 17th, 2015, 11:16 AM
#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.
-
November 17th, 2015, 11:26 AM
#2
Re: I need programming help quick!
You probably should have started asking for help a week ago. Good luck.
-
November 17th, 2015, 01:20 PM
#3
Re: I need programming help quick!
 Originally Posted by KitBoy
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
-
November 17th, 2015, 01:25 PM
#4
Re: I need programming help quick!
But you won't learn this way.
ahoodin
To keep the plot moving, that's why.

-
November 17th, 2015, 02:14 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|