Q. Are the files of type text or binary?
A. Text.
Q. Are the transaction files sorted?
A. All files (master and transaction files) are sorted by the
field "identifier".
Q. For transaction of Type=4, where should we output the information
to be listed?
A. This can be sent to the standard output (stdout).
Q. How do I create the master file and transaction files ?
A. You can use a text editor or a program to create them.
All that we want to see are the files, regardless of how you
created them. Remember to create your files sorted by Identifier.
Q. Which is the format for the files that we should use?
A. You must the following format: the records are organized by lines,
the fields are in fixed size columns with no separators and occupying
168 characterers plus an end of line. In the same order as in the
assignment handout, the fields have the following lengths:
9,4,20,30,30,15,15,15,15,5,4,4,2.
Q. Are you going to give us a sample of each file?
A. Yes. We will give you an example of the file on the week of
October 13. Of course, you have to prepare and run your own
tests. A small sample with two records in the above mentioned
format is available on the webpage.
Q. The assignment mentions the program "tests.c", what is that about?
A. It's a typo. Remove ".c programs" from the second line from the
bottom of page 2. You must give printing copies of your tests
together with your C program. Marks will be given for good choice
of tests.
Q. How do the transaction records on the files at Erindale, St. George
and Scarborough appear?
A. There is a missing Type = 5. In addition with the other four
types, we can have "Type = 5 send xxx copies of book number yyy"
in the transaction records. The relevant fields in these records
are the type field with value 5, the identifier, the ISBN for the
book yyy, and the number of copies xxx in the field NumbCopies.
Q. What should I do with fields that are not relevant for certain
transaction?
A. It is up to you if you will ignore them or use some of them for
error checking purposes.
Q. How many error checking we should do?
A. At least 5 conceptually different errors should be checked.
Q. Can we read the entire files into main memory?
A. No. If you do so, your mark is zero.
Q. Do we have to process all the transaction with same identifier
before storing the information in the newmaster file?
A. Yes, you must write the newmaster file only once per identifier.
Q. Can we have several transaction with same identifier (on same
transaction file or in different transaction files)?
A. Yes, there may be several records in transaction files with the
same identifier.
Q. When there are several transaction for the same identifier,
which is done first?
A. We are not concern about that. The only things that matters is
the correctness of the result depending on the order processed
by your algorithm. Yes, your friend might have a different answer
for the same data. Ex: the result will be different if you first
delete and then ask for copies of the same book, than if you first
ask for copies and then delete. Both are correct for us.
Q. Assuming we have more than 4 transaction files, how the command
line would be modified?
A. It would be:
books master t0 t1 .... tn newmaster newrequests error.log
The order of the arguments is important. The program should work
with different names. However, the tests you will submit electronically
must work with: books master t0 t1 t2 t3 newmaster newrequests error.log