Programming Logic and Design Fourth Edition, Introductory

Slides:



Advertisements
Similar presentations
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
Advertisements

Chapter 9: Advanced Array Manipulation
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
Reports IT Key Ideas, Dynamic Database Systems, 2002 Chapter 5.
Programming Logic and Design, Second Edition, Comprehensive
Header and footer basics Add page numbers, date, and more Think of page formatting in a book. The book title is at the top of one page, the chapter title.
This presentation includes custom animations. To view the animations, you must view the presentation in Slide Show mode and activeX controls must be allowed.
Chapter 7: Control Breaks Programming Logic and Design, Third Edition Comprehensive.
Programming Logic and Design Fourth Edition, Introductory
Understanding the Mainline Logical Flow Through a Program (continued)
Programming Logic and Design Fourth Edition, Comprehensive
General Algorithms for Common Business Problems
CTS130 Spreadsheet Lesson 13 Working with Lists. Copying Data between Workbooks  Use the [Copy ]and [Paste] Buttons  Use the CTRL+[C] and CTRL + [V]
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Developing Effective Reports
Informer Web Reporting Basic Reporting
CS1100: Access Reports Microsoft Access Report Construction Created By Martin Schedlbauer CS11001Microsoft Access.
Structured COBOL Programming, Stern & Stern, 9th Edition PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured.
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
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)
Chapter 13 Sequential File Processing. Master Files Set of files used to store companies data in areas like payroll, inventory Usually processed by batch.
Chapter 17. Copyright 2003, Paradigm Publishing Inc. CHAPTER 17 BACKNEXTEND 17-2 LINKS TO OBJECTIVES Mail Merge Wizard Letters Envelopes Labels Directory.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 6: Sequential Data Files.
Array Processing.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
Chapter 5-1. Chapter 5-2 Chapter 5: Database Forms and Reports Introduction Forms Reports.
Chapter 5-1. Chapter 5-2 Chapter 5: Database Forms and Reports Introduction Forms Reports.
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.
6 Chapter 61 Looping Programming Logic and Design, Second Edition, Comprehensive 6.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 6 Looping.
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.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
5 1 Data Files CGI/Perl Programming By Diane Zak.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 8 Arrays.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
OpenEMR: Patient Notes & Transactions Based on OpenEMR 4.1 Laboratory Informatics Institute January 2014.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
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)
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 17: Linked Lists (part 3)
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.
Chapter 9 General algorithms for common business problems.
Sequential Processing to Update a File Please use speaker notes for additional information!
Adding Reports to a Database. Why do we use Reports? Reports are well-designed printed pages that offer several advantages: Reports are well-designed.
Visual Basic - Break Processing
Chapter 6: Sequential Data Files
Microsoft Office Illustrated Introductory, Windows Vista Edition
Programming Logic and Design Fourth Edition, Comprehensive
Programming Logic and Design Eighth Edition
Chapter 7 Files and Exceptions
Programming Logic and Design Fourth Edition, Comprehensive
Designing and Writing Control-Break Programs
Iteration: Beyond the Basic PERFORM
CHAPTER 17 The Report Writer Module
Chapter 2 The Balance Sheet
Chapter 18 Finalizing a Database.
Microsoft Office Illustrated Introductory, Windows XP Edition
Presentation transcript:

Programming Logic and Design Fourth Edition, Introductory Chapter 7 Control Breaks

Objectives Understand control break logic Perform single-level control breaks Use control data within a heading in a control break module Use control data within a footer in a control break module Perform control breaks with totals Programming Logic and Design, Introductory, Fourth Edition

Objectives (continued) Perform multiple-level control breaks Perform page breaks Programming Logic and Design, Introductory, Fourth Edition

Understanding Control Break Logic Control break: temporary detour in program logic Control break program: Program in which a change in a variable’s value causes special or unusual processing to occur Helps organize output from processing data records When a grouping variable is changed, special actions such as subtotals and new subheadings may occur Control break report: report with items in groups, including subtotals by group Programming Logic and Design, Introductory, Fourth Edition

Understanding Control Break Logic (continued) Programming Logic and Design, Introductory, Fourth Edition

Understanding Control Break Logic (continued) Input records must be organized in sequential order based on the grouping field Sorting: rearranging records in a particular order Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page Developing the application: The input file Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Developing the application: Program contains a single-level control break Based on the department number variable Control break field: saves the information needed to determine when a break should occur Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) If record’s value differs from control break field value Print headings for a new page Update the control break field Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Developing the application: The finish() module Programming Logic and Design, Introductory, Fourth Edition

Performing a Single-Level Control Break to Start a New Page (continued) Programming Logic and Design, Introductory, Fourth Edition

Using Control Data Within A Heading In a Control Break Module Control data can be used as part of page heading Programming Logic and Design, Introductory, Fourth Edition

Using Control Data Within A Heading In a Control Break Module (continued) Programming Logic and Design, Introductory, Fourth Edition

Using Control Data Within A Footer In a Control Break Module Footer: message printed at end of page or section Control data can be used as part of a page footer Programming Logic and Design, Introductory, Fourth Edition

Using Control Data Within A Footer In a Control Break Module (continued) When a control break occurs, the program must: Print the footer for the previous group Print the heading for the new group Update the control break field For the very last group, the program must: Print the footer for the last group Not print another heading First heading and last footer must be handled separately from the others Programming Logic and Design, Introductory, Fourth Edition

Using Control Data Within A Footer In a Control Break Module (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals Developing the application: The input file Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) Developing the application: The desired output Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) Desired output: sort and total by category Two variables needed to manage grouping and totals Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) Processing each record: If category matches, increase category total by 1 If category does not match: Print total for previous category Add category total to grand total Reset category counter to 0 Update control break field Programming Logic and Design, Introductory, Fourth Edition

Performing Control Breaks with Totals (continued) For last record: Print total for previous category Add category total to grand total Print grand total Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks Summary report: group totals, not detail records Multiple-level control break: breaks occur for more than one change in condition Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Need two control break modules (city and state) City break processing: Print totals for previous city Add city count to state count Reset city count to 0 Update control break field for city Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) State break processing: Process the city break module first Print totals for previous state Add state count to grand total Reset state count to 0 Update control break field for state Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Must check for state break before city break When city changes, state might also change When state changes, city must also change Could have the same city names in different states Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Multiple-Level Control Breaks (continued) Within each break module, check if you need to: Perform the lower-level break (if any) Perform control break processing for previous group Roll up the current-level totals to next higher level Reset the current-level totals to 0 Perform any control break processing for new group Update the control break field Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks Control break logic can be used to start a new page based on number of lines printed Must maintain a count of lines printed Break when line count reaches a predetermined value Line-counter: a variable used to count printed lines Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks (continued) startNewPage() module: Does not perform a lower-level break Does not perform any control break processing for previous group Does not roll up current-level totals Does not reset current-level totals Does perform control break processing for new group by printing page headings Does update the control break field (line counter) Programming Logic and Design, Introductory, Fourth Edition

Performing Page Breaks (continued) Programming Logic and Design, Introductory, Fourth Edition

Summary Control break: a change in a variable’s value causes special actions to occur Control break field: holds data from a previous record to compare to the current record Control data can be used in a heading or footer Control break report contains and prints totals for each group, as well as grand totals Programming Logic and Design, Introductory, Fourth Edition

Summary (continued) For multiple-level control breaks, test for a major-level break before a minor-level break In a control break, check if lower-level breaks need to be processed Page breaks can be handled based on line counters Programming Logic and Design, Introductory, Fourth Edition