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.
Re: I need programming help quick!
You probably should have started asking for help a week ago. Good luck.
Re: I need programming help quick!
Quote:
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
Re: I need programming help quick!
But you won't learn this way.
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.