Quiz 5: The Tools of the Trade

Computing

Assuming a sequential master file which contains name and address data of magazine subscriber, there can be three types of transaction insertion, modification, deletions as follows:- Type1: INSERT (a new subscriber into master file) Type2: MODIFY (an existing subscriber record) Type3: DELETE (an existing subscriber record) Below is a 3X3 table with row representing current transaction and column representing next transaction. The table shows the action to be taken on the basis of following given criteria:- Two successive insertion of same record will be an ERROR Two successive modification of same record will be VALID img There are two input files and three output files are maintained (Assuming that transactions are sorted into alphabetical order by name of subscriber) Input files are:- 1. Old master file(name and address records) 2. Transaction file Output files:- 1. New master file(name and address records) 2. Exception report 3. Summary and end of job message A flowchart for the third refinement that incorporates look ahead is shown below on the basis of following criteria:- • Before processing a transaction next transaction must be read. • If both transactions apply to same file, the current transaction processing will depend on type of next transaction. • Provision for end-of-file condition. img img

There are six possible orderings: 1.?INSERT, DELETE, MODIFY.  This does not work when an INSERT is fol­lowed by a DELETE of the same record. 2.?INSERT, MODIFY, DELETE.  Ordering in the textbook. 3-6.?The remaining four orderings (in which INSERT comes either second or third) also will not work because INSERT has to precede both DELETE and MODIFY.

Separation of concerns is the process of breaking a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest on focus in a program. Typically concerns are synonymous with features or behaviours. Process towards Separation of concerns is achieved through modularity. Separation of concerns tackles with the complexity of large systems by separating different issues to concentrate on one at a time. This can be done with the help of Divide and conquer tool. This supports parallelization of efforts and separations of responsibility. Separation of concerns helps to:- • Divide a problem into parts that can be dealt with separately. • Create an understanding of how the parts depend on/relate to each other. Special cases of serration of concerns can be:- Divide and conquer "Vertically" Divide and conquer "Horizontality"