Programming Logic and Design Fourth Edition, Introductory

Slides:



Advertisements
Similar presentations
P5, M1, D1.
Advertisements

Chapter 3: Modules, Hierarchy Charts, and Documentation
Chapter 3: Modularization
Chapter 2: Modularization
Computers Are Your Future
Modules, Hierarchy Charts, and Documentation
ALGORITHMS THIRD YEAR BANHA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATIC Lecture two Dr. Hamdy M. Mousa.
Programming Logic and Design Fourth Edition, Introductory
Program Design and Development
Chapter 2: Input, Processing, and Output
Modules, Hierarchy Charts, and Documentation
Understanding the Mainline Logical Flow Through a Program (continued)
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
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.
Chapter 3 Planning Your Solution
Programming Logic and Design Fourth Edition, Introductory
An Overview of Computers and Programming
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
CS102 Introduction to Computer Programming
Variables, Constants, Methods, and Calculations Chapter 3 - Review.
Chapter 2: Developing a Program Prelude to Programming Concepts and Design Copyright © 2001 Scott/Jones, Inc.. All rights reserved. 1 Chapter 2 Developing.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Structured COBOL Programming, Stern & Stern, 9th edition
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
Simple Program Design Third Edition A Step-by-Step Approach
CIS Computer Programming Logic
Programming Logic and Design Fifth Edition, Comprehensive
SE: CHAPTER 7 Writing The Program
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Programming Logic and Design Using Methods. 2 Objectives Review how to use a simple method with local variables and constants Create a method that requires.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Chapter 8 First steps in modularisation. Objectives To introduce modularisation as a means of dividing a problem into subtasks To present hierarchy charts.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Systems Design.  Application Design  User Interface Design  Database Design.
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.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Programming Logic and Design Fifth Edition, Comprehensive Chapter 7 Using Methods.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Chapter 2: Input, Processing, and Output
System Design.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
Designing and Debugging Batch and Interactive COBOL Programs
Chapter 2- Visual Basic Schneider
Programming Logic and Design Fourth Edition, Comprehensive
Topics Introduction to Functions Defining and Calling a Void Function
Writing a Complete Program
Topics Introduction to Functions Defining and Calling a Function
Chapter 2: Input, Processing, and Output
Modules, Subroutines, Procedures, Functions, or Methods
Chapter 4: Writing and Designing a Complete Program
Programming Logic and Design Eighth Edition
Presentation transcript:

Programming Logic and Design Fourth Edition, Introductory Chapter 3 Modules, Hierarchy Charts, and Documentation

Objectives Describe the advantages of modularization Modularize a program Understand how a module can call another module Explain how to declare variables Create hierarchy charts Programming Logic and Design, Introductory, Fourth Edition

Objectives (continued) Understand documentation Design output Interpret file descriptions Understand the attributes of complete documentation Programming Logic and Design, Introductory, Fourth Edition

Modules, Subroutines, Procedures, Functions, or Methods Unit of code that performs one small task Called a subroutine, procedure, function, or method Modularization: breaking a large program into modules Programming Logic and Design, Introductory, Fourth Edition

Modules, Subroutines, Procedures, Functions, or Methods (continued) Advantages of modularization: Provides abstraction Allows multiple programmers to work simultaneously Allows code reuse Makes identifying structures easier Programming Logic and Design, Introductory, Fourth Edition

Modularization Provides Abstraction Focusing on important properties while ignoring non-essential details Avoids the low-level details and uses a high-level approach Makes complex tasks look simple Programming Logic and Design, Introductory, Fourth Edition

Modularization Provides Abstraction (continued) A To-Do list with abstraction: without abstraction: Programming Logic and Design, Introductory, Fourth Edition

Modularization Allows Multiple Programmers to Work on a Problem Large programming projects can be divided into modules Modules can be written by different programmers Development time is significantly reduced Programming Logic and Design, Introductory, Fourth Edition

Modularization Allows You to Reuse Your Work Reusability: the ability to use modules in a variety of applications Reliability: assurance that a module has been tested and proven to function correctly Programming Logic and Design, Introductory, Fourth Edition

Modularization Makes It Easier to Identify Structures Combining several tasks into modules may make it easier for beginning programmers to: Determine if a program is structured Identify structures in a program Experienced programmers modularize for abstraction, ease of dividing the work, and reusability Programming Logic and Design, Introductory, Fourth Edition

Modularization Makes It Easier to Identify Structures (continued) Is this structured? Programming Logic and Design, Introductory, Fourth Edition

Modularization Makes It Easier to Identify Structures (continued) Programming Logic and Design, Introductory, Fourth Edition

Modularizing a Program Most programs contain a main module Contains the mainline logic Accesses other modules or subroutines Rules for module names used here: Must be one word Should be meaningful Are followed by a set of parentheses Programming Logic and Design, Introductory, Fourth Edition

Modularizing a Program (continued) Programming Logic and Design, Introductory, Fourth Edition

Modularizing a Program (continued) Calling program (or calling module): one that uses another module Flowchart symbol for calling a module: a rectangle with bar across the top Flowchart for the module contains: Module name in the start symbol exit or return in the stop symbol When a module is called, logic transfers to the module When module ends, logic transfers back to the caller Programming Logic and Design, Introductory, Fourth Edition

Modularizing a Program (continued) Programming Logic and Design, Introductory, Fourth Edition

Modules Calling Other Modules Programming Logic and Design, Introductory, Fourth Edition

Modules Calling Other Modules (continued) Knowing when to break a module into its own subroutines or submodules is an art Best practice: place together statements that contribute to one specific task Functional cohesion: extent to which the statements contribute to the same task Programming Logic and Design, Introductory, Fourth Edition

Declaring Variables Declaring a variable involves: Providing a name for the memory location where the value will be stored Specifying the type of the data Data types used here: num for number values char for all other values Where and when a variable must be declared is language-dependent Programming Logic and Design, Introductory, Fourth Edition

Declaring Variables (continued) Local variables: declared within a module Global variables: declared at the beginning of the program, and used in all modules Annotation box: flowchart symbol containing notes Data Dictionary: list of variables used in a program, with their type, size, and description Programming Logic and Design, Introductory, Fourth Edition

Declaring Variables (continued) Programming Logic and Design, Introductory, Fourth Edition

Creating Hierarchy Charts Illustrates modules’ relationships Tells which routines call which other routines Does not tell when or why the modules are called Programming Logic and Design, Introductory, Fourth Edition

Creating Hierarchy Charts (continued) Blackened corner indicates a module that is used more than once Programming Logic and Design, Introductory, Fourth Edition

Understanding Documentation All supporting material that goes with a program Two major categories: for users and for programmers Usually created by system analysts and/or tech writers May be printed or electronic (Web or CD) End users: people who use computer programs Program Documentation: Internal program documentation: comments within code External program documentation: supporting paperwork written before programming begins Programming Logic and Design, Introductory, Fourth Edition

Output Documentation Usually written first Represents the information needed by end users May be initially created by end users Printed reports: designed using a print chart Programming Logic and Design, Introductory, Fourth Edition

Output Documentation (continued) Printed reports usually contain: Detail lines: display data details Heading lines: contain title and column headings Total (or summary) lines: may contain statistics or end of report indicators Printed reports may contain only summary information Reports may be displayed on screens and not printed GUI: graphical user interface Programming Logic and Design, Introductory, Fourth Edition

Input Documentation Input documentation: describes what input is available to produce the output File description: Describes the data stored in a file Indicates fields, data types, and lengths Programming Logic and Design, Introductory, Fourth Edition

Input Documentation (continued) Byte: unit of computer storage that can contain any of 256 combinations of 0s and 1s to represent characters Programmers usually create one variable for each data field in an input file Some report fields may be calculated results Programming Logic and Design, Introductory, Fourth Edition

Input Documentation (continued) Programmers need to know: Data file name Data fields and their order within the file Data types of each field Programming Logic and Design, Introductory, Fourth Edition

Input Documentation (continued) Programming Logic and Design, Introductory, Fourth Edition

Completing the Documentation Program documentation may contain: Output design Input description Flowcharts Pseudocode Program code listing User documentation may contain Manuals Instructional material Operating instructions Programming Logic and Design, Introductory, Fourth Edition

Completing the Documentation (continued) User documentation: Written clearly in plain language Usually prepared by system analysts and/or tech writers User documentation usually indicates: How to prepare input Output distribution Output interpretation Error message information Run frequency Programming Logic and Design, Introductory, Fourth Edition

Summary Modules, subroutines, procedures, functions, methods: smaller, reasonable units of code that provide reusability Modules can call other modules Variable declarations define the name and type of the data to be stored Hierarchy chart illustrates modules’ relationships Documentation: all supporting material for a program Programming Logic and Design, Introductory, Fourth Edition

Summary (continued) Output documentation: includes report designs File description: details data types and lengths of each field of data in the file User documentation: includes manuals and instructional materials for non-technical people, and operating instructions for operators and data-entry people Programming Logic and Design, Introductory, Fourth Edition