Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 9 General algorithms for common business problems.

Similar presentations


Presentation on theme: "Chapter 9 General algorithms for common business problems."— Presentation transcript:

1 Chapter 9 General algorithms for common business problems

2 Objectives To provide general pseudocode algorithms for four common business applications. Topics covered are: – report generation with page break – single-level control break – multiple-level control break – sequential file update

3 9.1 Program structure

4 General solution algorithm consists of mainline module and three subordinate modules. These are: 1.An initial processing module, containing steps to be performed at the beginning of the algorithm 2.A processing module inside the loop containing all the steps necessary to process records 3.Final processing module, containing the steps to be performed at the end of the algorithm

5 Program structure This basic solution algorithm forms the framework for most commercial business programs This general solution algorithm can be also modularised: Process_ sequential_file Perform_initial_ processing Process_ this_record Perform_final_ processing

6 Program structure Skeleton solution in pseudocode looks like below: Process_sequential_file Initialise processing Read first record DOWHILE more records exist Process this record Read next record ENDDO Final processing END

7 9.2 Report generation with page break

8 Most reports require page heading lines, column heading lines, detail line and total lines General solution algorithm for processing a sequential file can be extended by the addition of new modules that cater for there reports requirements

9 Report generation with page break Hierarchy chart Print_report_ program Initialise_ variable_fields Print_page_ headings Process_ this_records Print_report_ totals Print_detail_ line Accumulate_ total_fields

10 9.3 Single-level control break

11 Printed reports that also produce control break total lines are very common in business application Control break total line is a summary line for a group of records that contain the same record, and is referred to as the control field

12 Single-level control break Hierarchy chart Produce_single_ level_control_ break Initialise_ variable_fields Print_page_ headings Process_ this_records Print_report_ totals Print_detail_ line Accumulate_ total_fields Print_control total_line Reset_ control_totals

13 9.4 Multiple-level control break

14 Reports are required to produce multiple-level control break totals Example of a hierarchy chart shown on next slide

15 Multiple-level control break Hierarchy chart Produce_multiple_ level_control_ break Initialise_ variable_fields Print_page_ headings Process_ this_records Print_report_ totals Print_detail_ line Accumulate_ total_fields Print_major control_totals Reset_minor control_totals Print_minor control_totals Reset_major control_totals

16 9.5 Sequential file update

17 Master file – Is a file that contains permanent and semi-permanent information about the data entities it contains Transaction file – Contains all the data and activities that are included on the master file. These are transactions to: Add a new record Update or change an existing record Delete an existing record

18 Sequential file update Audit report – Is a detailed list of all the transactions that were applied to the master file Error report – Is a detailed list of errors hat occurred during the processing of the update

19 Sequential file update Sequential update logic – Sequential processing falls generally into three categories: 1.If the key on the transaction record is less than the key on the old master record, the transaction is probably an add transaction 2.If they key on the transaction record is equal to the key on the old master record, the transaction is probably an update or delete transaction 3.If the key on the transaction record is greater that the key on the old master record, there is not matching transaction for that master record

20 Summary Developed general hierarchy charts to four common business applications. Applications covered were: – report generation with page break – single-level control break – multiple-level control break – sequential file update.


Download ppt "Chapter 9 General algorithms for common business problems."

Similar presentations


Ads by Google