CISC 3110 - Homework #8
Due: Monday, December 19. Email me that it is posted on your website.
This assignment adds strings and files to your database program.
-
Add a member variable to your gameItem class to hold the 'name' of the game. You may use either a C-string or C++ string.
You will then have to check each function to see whether it needs modification. For example, you will have to read in the name of the game when adding a game, and print names when printing.
- Add the saving feature to your program. This should be a new menu item. In addition, before the user exits, if there are unsaved changes, ask "would you like to save this session to disk?"
- When the program begins running, ask the user for the name of the file that stores the information about previous games.
Check whether the file exists, and read in the initial data from the file.
Note: If you are using C++ strings or any type of pointer data, do NOT use binary files.
OPTIONAL
For extra credit, you may save versions of the database. Each time the database is saved, append the date and time to the file name. Allow the user to access backup versions.
Also, you can write two versions of the program, one that uses text files, and one that uses binary files. You can also attempt to modify only one record on disk, using random access, without reading the entire database into memory.