Question: In C++ How To Program (8th Edition) book , Solve this problem 17.10 Case Study: A Transaction-Processing Program ---------------------------------------------------------------------------------------- 1- Copy the case study program
In C++ How To Program (8th Edition) book , Solve this problem 17.10 Case Study: A Transaction-Processing Program ---------------------------------------------------------------------------------------- 1- Copy the case study program from the book page 680 and get it running. 2- Modify the case study, so that client data contains branchID as Integer that holds the branch id of the client. 3- Modify the case study again, add another functionality called "Backup Data" which copies the client data file to another file called backup.dat. 4- Modify the case study again, add another functionality called "Restore Data" which copies the client data from the backup file to credit.dat. 5- The program should check for existing files, if the credit.dat doesn't exist, it should create it and insert 100 blank records. If backup.dat doesn't exist, it should display an error on restore. 6- Modify the case study again, add another functionality called "Create Index Files" which creates two index files, a primary index file, "primary_index.dat", and a secondary one "secondary_index.dat" organized by last name, that will enable you later (in the next assignment) to search by the last name. 7- Modify the case study again, add another functionality called "Create text files for Index Files" which creates two text files, "primary_index.txt", and "secondary_index.txt" that correspond the index files. -------- - More details about item 6 :- The structure of the primary index object is very simple. It is a list of pairs of fields: a primary key field (as the account number in our example) and a byteoffset field of the corresponding record. There is one entry in the primary index file for each record in the data file even if this record is a blank record. The primary index file must be fixed-length record file and is sorted by the primary key field. The structure of the secondary index object is also very simple. It is a list of pairs of fields: a secondary key field (as the last name in our example) and a set of primary key references that contains the primary key fields (the account numbers) of the records in which the secondary key (the last name) occurs, since a given secondary key might occur more than once in the data file. (in our example, this set will be an array of integers of length 100 which contains the account numbers of the records in which the last name occurs. Set the default values of this array to the value -1). You will create two additional classes (.h and .cpp for each of them) that define the record structure of each index file as mentioned. Reading and Writing will be carried out in the binary mode as in the case study and you will deal with the whole object in both reading and writing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
