Structured COBOL Programming, Stern & Stern, 9th edition

Slides:



Advertisements
Similar presentations
Programming Logic and Design Fourth Edition, Introductory
Advertisements

CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
5-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 9 Describing Process Specifications and Structured Decisions
Program Flow Charting How to tackle the beginning stage a program design.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
Programming Logic and Design Fourth Edition, Introductory
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
COBOL for the 21st Century
Structured COBOL Programming
System Implementation System Implementation - Mr. Ahmad Al-Ghoul System Analysis and Design.
4-1 Coding Complete COBOL Programs: The PROCEDURE DIVISION Chapter 4.
4-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)
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
4-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)
1 Chapter 4. To familiarize you with methods used to 1. Access input and output files 2. Read data from an input file 3. Perform simple move operations.
Simple Program Design Third Edition A Step-by-Step Approach
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Chapter To familiarize you with  Why COBOL is a popular business-oriented language.  Programming practices and techniques  History of COBOL.
Structured COBOL Programming
1-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)
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Programming Lifecycle
Designing and Debugging Batch and Interactive COBOL Programs Chapter 5.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
1 Interactive vs Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Chapter 7 File I/O 1. File, Record & Field 2 The file is just a chunk of disk space set aside for data and given a name. The computer has no idea what.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
5-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
1 Program Planning and Design Important stages before actual program is written.
Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER 2 Cobol Language Fundamentals.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Submitted To: Rutvi sarang Submitted By: Kushal Bhagat.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
The Hashemite University Computer Engineering Department
Chapter 4 PROCEDURE DIVISION. Paragraphs PROCEDURE DIVISION divided into paragraphs Each is independent module or routine Made up of series of instructions.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
 Problem Analysis  Coding  Debugging  Testing.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
CSCI-235 Micro-Computer Applications
DDC 1023 – Programming Technique
Chapter 2- Visual Basic Schneider
Understand the Programming Process
Designing and Debugging Batch and Interactive COBOL Programs
An Introduction to Structured Program Design in COBOL
Chapter 2- Visual Basic Schneider
Chapter 1 Introduction(1.1)
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
Understand the Programming Process
Chapter 11 Describing Process Specifications and Structured Decisions
Programming Logic and Design Eighth Edition
Presentation transcript:

Structured COBOL Programming, Stern & Stern, 9th edition Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL Structured COBOL Programming, Stern & Stern, 9th edition

COMPUTER PROGRAMMING: AN OVERVIEW Structured COBOL Programming, Stern & Stern, 9th edition

Types of Computer Programs COBOL is one of the many languages used to write customized applications programs. Structured COBOL Programming, Stern & Stern, 9th edition

Applications Programs Interactive vs. Batch Processing Interactive applications typically accept input data from a PC, workstation, or terminal. Batch Processing applications process large volumes of input at periodic intervals. Structured COBOL Programming, Stern & Stern, 9th edition

Applications Programs Applications programs that are written for a specific user are called customized programs. Programs that are relatively standard are application packages that might be purchased. Structured COBOL Programming, Stern & Stern, 9th edition

Machine Language Programs All programs executed by the computer must be in machine language. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition Symbolic Programs Symbolic Programs use English-like or symbolic instructions. These programs must be translated or compiled into machine language. COBOL is a symbolic programming language used for commercial applications. Structured COBOL Programming, Stern & Stern, 9th edition

THE APPLICATIONS PROGRAM DEVELOPMENT PROCESS

PROGRAM DEVELOPMENT PROCESS 1. Determine Program Specifications Program Specifications consist of the following: Record layout forms to describe the input and output Printer spacing charts for printed output Screen layouts for interactive input/output Structured COBOL Programming, Stern & Stern, 9th edition

PROGRAM DEVELOPMENT PROCESS 2. Design the Program Using Program Planning Tools using Common Tools: Flowcharts A block diagram providing a pictorial representation of the logic to be used in a program Pseudocode English-like expressions to depict the logic of the program Hierarchy Charts Charts showing relationships among sections in a program Structured COBOL Programming, Stern & Stern, 9th edition

PROGRAM DEVELOPMENT PROCESS 3. Code and Enter the Program 4. Compile the Program The COBOL compiler checks the source code to insure there are no rule violations. A syntax error is a type of error that is found if a programming rule is violated. Structured COBOL Programming, Stern & Stern, 9th edition

PROGRAM DEVELOPMENT PROCESS 5. Test the Program Programs are tested or debugged to ensure they have no errors. A logic error is a type of error that the programmer may find only when the program is tested with sample or test data. 6. Document the Program Procedure manuals for users and computer operators, called documentation, is prepared for use by the operating staff for regular production. Structured COBOL Programming, Stern & Stern, 9th edition

PROGRAM DEVELOPMENT PROCESS ************************************************ Remember, coding is undertaken only after the program requirements have been fully specified and the logic has been carefully planned. ************************************************* Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition DEBUGGING TECHNIQUES Desk Checking Reviewing the program before and after keying Correcting Syntax Errors Using the printed source list of the diagnostic messages to find and correct the errors Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition DEBUGGING TECHNIQUES Program Walkthroughs Manually stepping through the program with test data. Detecting Logic Errors by Executing the Program Often the most difficult part of debugging. The preparation of test data is an extremely critical aspect of debugging. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition THE NATURE OF COBOL COBOL is a Business-Oriented Language COBOL, is one of the most widespread commercial applications languages in use today. COBOL is an abbreviation for COmmon Business Oriented Language, COBOL is a Standard Language COBOL is a common programming language available on most computers. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition THE NATURE OF COBOL COBOL is an English-like Language All instructions can be coded using English words. The rules conform to many rules for writing in English COBOL is a User-Friendly Language Because users are able to understand the English-like instructions it is considered a user-friendly language. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition THE FUTURE OF COBOL COBOL is likely to remain an important language in the years ahead for three reasons: 1. Older, mainframe-based “legacy” systems will need to be maintained by maintenance programmers who know COBOL. 2. COBOL is still being used by many organizations for new application development. 3. It is a very efficient language. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition QUESTIONS?! Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 1. A program must be in _________ language to be executed or run. Solution: machine Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 2. Programs are typically written in a _______ language rather than in machine language because __________. Solution: symbolic; machine languages are very complex Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 3. Programs written in a language other than machine language must be _______ before execution can occur. Solution: translated or compiled Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 4. The process of converting a source program into machine language is called ___________. Solution: compilation or translation Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 5. The program written in a programming language such as COBOL is called the ________ program. Solution: source or applications Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 6. The object program is the _______. Solution: set of instructions that has been converted into machine language Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 7. A ______ converts a source program into a(n)_____ program. Solution: compiler or translator program: object or machine language Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 8. The errors that are detected during compilation denote ______; they are usually referred to as ________ errors. Solution: any violation of programming rules in the use of the symbolic programming language; syntax Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 9. Before executing a program with test data, the logic of the program can be checked manually using a technique called a ____________. Solution: program walkthrough Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 10. COBOL is an abbreviation for _________. Solution: Common Business Oriented Language Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SELF-TEST QUESTIONS 11. COBOL is a common language in the sense that ______. Solution: it can be used on many computers Structured COBOL Programming, Stern & Stern, 9th edition

TECHNIQUES FOR IMPROVING PROGRAM DESIGN Structured COBOL Programming, Stern & Stern, 9th edition

Structured Programming Using Modular Design for Coding Paragraphs The most important technique for improving the design of a program in any language is called structured programming. Structured Programming is a technique using logical control constructs that make programs easier to read, debug, and modify if changes are required. Structured COBOL Programming, Stern & Stern, 9th edition

Structured Programming Using Modular Design for Coding Paragraphs Structured programming is often called GO-TO-less programming since programmatic branches do not use GO TO statements. In COBOL this means writing programs using PERFORM statements Structured COBOL Programming, Stern & Stern, 9th edition

Structured Programming Using Modular Design for Coding Paragraphs The typical structured program is divided into paragraphs or modules, where a main module calls in other modules as needed. Each module can be tested independently. Paragraph, routine, module are used interchangeably Structured COBOL Programming, Stern & Stern, 9th edition

The Top-Down Approach for Coding Modules Proper design is best achieved by developing major modules before minor ones. Main routines are coded first and are followed by intermediate routines and then minor ones. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition The Top-Down Approach Coding using the top-down manner gives the primary attention to the origination of the program. Details are deferred or saved for minor modules, which are coded last. Structured COBOL Programming, Stern & Stern, 9th edition

A BRIEF OVERVIEW OF PROGRAM PLANNING TOOLS Structured COBOL Programming, Stern & Stern, 9th edition

RULES FOR INTERPRETING PSEUDOCODE 1. A pseudocode begins with a START and ends with a STOP. 2. All instructions are read in sequence. 3. The instructions between the: PERFORM...END-PERFORM are executed repeatedly UNTIL there are no more records to process. Structured COBOL Programming, Stern & Stern, 9th edition

HIERARCHY OR STRUCTURE CHART Structure charts identify WHAT each module does, and how it relates to other modules. The following chart shows the relationships among modules in a program: 100-MAIN MODULE 200-WAGE ROUTINE Structured COBOL Programming, Stern & Stern, 9th edition

CHAPTER SLIDES END HERE CHAPTER SUMMARY COMES NEXT Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition CHAPTER SUMMARY A. The Nature of COBOL 1. It is the most widespread commercial programming language in use today. 2. COBOL is the abbreviation for Common Business Oriented Language. 3. It is an English-like language. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY B. Program Preparation and Debugging Get program specifications from the analyst or prepare them yourself. Use planning tools--flowcharts, pseudocode, hierarchy charts--for program design. Code the program. Compile the program and fix syntax errors. Test the program using debugging techniques. Document the program. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY C. Techniques for Improving Program Design 1. Structured Programming a. Referred to as GO-TO-less programming b. Structured programs are subdivided into modules or paragraphs. 2. Top-Down Programming a. Major modules are coded before minor ones. B. Similar to developing an outline before writing a report. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY D. The COBOL Divisions Identification Division a. Identifies the program to the computer system. b. May provide some documentation as well. c. PROGRAM-ID is the only required entry. Environment Division Assigns a file-name to each file used. Specifies the device that the file will use. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY Data Division a. Defines & describes all input, output & work area b. File-Section (1) Each file-name is described in an FD. (2) Each record format within every file is an 01 entry. (3) Record fields are described with a PICTURE clause that specifies the size & type. c. Working-Storage Section (1) Defines work areas (2) An end-of-file indicator is coded here. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY COBOL DIVISIONS Procedure Division a. Subdivided into paragraphs or modules. b. Includes all instructions to process input and produce output. c. All instructions are executed sequence. PERFORM...UNTIL... END-PERFORM is a loop. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY Procedure Division c. All instructions are executed sequence, unless there is a loop such as PERFORM UNTIL... ….. END-PERFORM Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY Procedure Division d. Main-module entries: The following are typical entries in a main module: (1) Files are either INPUT or OUTPUT and activated in an OPEN statement. (2) A PERFORM... …. END-PERFORM is a loop that is executed until there are no more records. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY Main-module entries (continued): Within the PERFORM we often code a READ... AT END... NOT AT END… END-READ. (4) A CLOSE statement deactivates all files. (5) STOP RUN ends processing. Structured COBOL Programming, Stern & Stern, 9th edition

Structured COBOL Programming, Stern & Stern, 9th edition SUMMARY e. Calculation or processing paragraphs (1) These paragraphs are executed when a statement in the main module specifies a PERFORM paragraph name. (2) For example, logic for processing an input record may be contained in one or more paragraphs. Structured COBOL Programming, Stern & Stern, 9th edition