Chapter 9 General algorithms for common business problems.

Slides:



Advertisements
Similar presentations
Chapter 2: Modularization
Advertisements

Methodology for Program Development Tuition billing program –Specs –File descriptions –Report layout –Processing requirement $200/cr $25 union dues if.
Chapter 9: Advanced Array Manipulation
Repetition Control Structures
Repetition control structures
Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
Data Structures: A Pseudocode Approach with C
Data Structures: A Pseudocode Approach with C 1 Chapter 5 Contd... Objectives Explain the design, use, and operation of a linear list Implement a linear.
Programming Logic and Design Fourth Edition, Introductory
Programming Logic and Design, Second Edition, Comprehensive
Chapter 7: Control Breaks Programming Logic and Design, Third Edition Comprehensive.
Computer Science: A Structured Programming Approach Using C Converting File Type A rather common but somewhat trivial problem is to convert a text.
Programming Logic and Design, Third Edition Comprehensive
Chapter 2: Algorithm Discovery and Design
Metode Perancangan Program T0104
General Algorithms for Common Business Problems
Chapter 1 Program Design
Pseudocode Algorithms Using Sequence, Selection, and Repetition.
Metode Perancangan Program
Chapter 2: Algorithm Discovery and Design
Chapter 17 Sequential File Maintenance. Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM.
System Implementation System Implementation - Mr. Ahmad Al-Ghoul System Analysis and Design.
Structured COBOL Programming, Stern & Stern, 9th Edition PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured.
Chapter 07 Control Breaks.
10- 1 Chapter 10. To familiarize you with  Main types of computer-generated reports  Techniques used for efficient printing of group reports and control.
Programming Logic and Design Seventh Edition
10-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Pseudocode algorithms using sequence, selection and repetition
Simple Program Design Third Edition A Step-by-Step Approach
The Fun That Is File Structures Pages By: Christine Zeitschel.
Program Design Simple Program Design Third Edition A Step-by-Step Approach 9.
Array Processing.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
Indexed Files continued. Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM.
File Handling and Control Break Logic. Objectives In this chapter, you will learn about: Computer files Writing a program that reads from and/or writes.
13-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Sequential Files Chapter 13. Master Files Set of files used to store companies data in areas like payroll, inventory Set of files used to store companies.
Now, please open your book to page 60, and let’s talk about chapter 9: How Data is Stored.
Any Questions? Control Breaks Agenda Control Breaks –Also known as Reports with sub-totals.
General Algorithms for Common Business Problems Simple Program Design Third Edition A Step-by-Step Approach 10.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Pseudocode Algorithms Using Sequence, Selection, and Repetition
Repetition Control Structures Simple Program Design Third Edition A Step-by-Step Approach 5.
Pseudocode Algorithms Using Sequence, Selection, and Repetition Simple Program Design Third Edition A Step-by-Step Approach 6.
Chapter 8 First steps in modularisation. Objectives To introduce modularisation as a means of dividing a problem into subtasks To present hierarchy charts.
Worksheet for a Service Business
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
DOWHILE: Trailer Record Logic
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
Master File Update Processing. Objectives On completing this section you should be able to: w Distinguish between online processing and batch processing.
Code DescriptionColourSelling PriceNo. Sold C105MattPrimrose£ C106MattLilac£ C120SilkPrimrose£ C121SilkLilac£ C123SilkPlum£9.00.
1 Objectives ❏ To understand the differences between text and binary files ❏ To write programs that read, write, and/or append binary files ❏ To be able.
Control Break Processing
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
11 Chapter 111 Sequential File Merging, Matching, and Updating Programming Logic and Design, Second Edition, Comprehensive 11.
Sequential Processing to Update a File Please use speaker notes for additional information!
Chapter 7 CASE Control Structure © 2008 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Marilyn Bohl/Maria Rynn Tools for Structured.
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
Visual Basic - Break Processing
Computer Science Faculty
Programming Logic and Design Eighth Edition
Please use speaker notes for additional information!
Programming Logic and Design Fourth Edition, Comprehensive
STRUCTURED CONTROL: BASIC CONTROL OPERATORS
Pseudocode algorithms using sequence, selection and repetition
Structured COBOL Programming
Designing and Writing Control-Break Programs
CHAPTER 17 The Report Writer Module
Presentation transcript:

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 Program structure

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

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

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

9.2 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

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

9.3 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

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

9.4 Multiple-level control break

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

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

9.5 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

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

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

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.