1 / 20

Chapter 9

Chapter 9. General algorithms for common business problems. 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. 9.1.

nicolette
Download Presentation

Chapter 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Program structure • General solution algorithm consists of mainline module and three subordinate modules. These are: • An initial processing module, containing steps to be performed at the beginning of the algorithm • A processing module inside the loop containing all the steps necessary to process records • 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. Report generation with page break • 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. Single-level control break • 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_control total_line Print_detail_ line Accumulate_ total_fields Reset_ control_totals

  13. 9.4 Multiple-level control break

  14. Multiple-level control break • 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_minor control_totals Print_major control_totals Print_report_ totals Print_detail_ line Accumulate_ total_fields Reset_minor control_totals Reset_major control_totals

  16. 9.5 Sequential file update

  17. Sequential file update • 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: • If the key on the transaction record is less than the key on the old master record, the transaction is probably an add transaction • 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 • 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.

More Related