Top-down modular programming

1 5.4 Modular Design Top-Down Design Structured Programming Advantages of Structured Programming.

Slides:



Advertisements
Similar presentations
Modular Design Using Subroutines [functions later]
Advertisements

The LC-3 Chapter 6 COMP 2620 Dr. James Money COMP
Chapter 3: Modularization
Chapter 2: Modularization
Programming Logic and Design Fourth Edition, Introductory
Chapter 2 - Problem Solving
1 Chapter 5 - General Procedures 5.1 Function Procedures 5.2 Sub Procedures, Part I 5.3 Sub Procedures, Part II 5.4 Modular Design.
Chapter 4 General Procedures
Structured Programming structured programming: A technique for organizing and coding computer programs in which a hierarchy of modules is used, each having.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Chapter 4 - VB.Net by Schneider1 Chapter 4 General Procedures 4.1 Sub Procedures, Part I 4.2 Sub Procedures, Part II 4.3 Function Procedures 4.4 Modular.
Chapter 1 Principles of Programming and Software Engineering.
Understanding the Mainline Logical Flow Through a Program [continued]
Program Development and Programming Languages
Chapter 1 Program Design
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: Precise Effective Terminating.
Chapter 4 Sec. 4.1, 4.2, 4.4 Procedures [User-defined]
PRE-PROGRAMMING PHASE
OOP- OBJECT OBJECT PROGRAMMING By KRATI SHARMA 02 XI-B
Structured COBOL Programming, Stern & Stern, 9th edition
1 Shawlands Academy Higher Computing Software Development Unit.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Chapter 5 - VB 2008 by Schneider1 Chapter 5 - General Procedures 5.1 Sub Procedures, Part I 5.2 Sub Procedures, Part II 5.3 Function Procedures 5.4 Modular.
1 Chapter 5 - General Procedures 5.1 Function Procedures 5.2 Sub Procedures, Part I 5.3 Sub Procedures, Part II 5.4 Modular Design.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their Formal and mathematical.
CS0004: Introduction to Programming Subprocedures and Modular Design.
1 The Software Development Process Systems analysis Systems design Implementation Testing Documentation Evaluation Maintenance.
SOFTWARE DESIGN.
Programming Logic and Design Fifth Edition, Comprehensive
Chapter 13 Recursion. Learning Objectives Recursive void Functions Tracing recursive calls Infinite recursion, overflows Recursive Functions that.
Functions and Parameters. Structured Programming.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their Formal and mathematical.
I Power Higher Computing Software Development The Software Development Process.
Top-Down Design and Modular Development. The process of developing methods for objects is mostly a process of developing algorithms; each method is an.
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
Design Concepts By Deepika Chaudhary.
CPS120: Introduction to Computer Science Lecture 14 Functions.
CMSC 104, Version 8/061L17Top-DownDesign.ppt Top-Down Design Topics Top-Down Design Top-Down Design Examples The Function Concept Reading Sections 3.1.

The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
The Software Development Process
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Introduction to Flow Chart It is pictorial representation of process of a system or processes. Types of Flow charts Program Flow Chart System Flow chart.
Modular Design Top-Down Design. Design is represented by a hierarchy chart. Break a problem into individual tasks or modules. If a module is too complex,
Chapter 3 Top-Down Design with Functions Part II J. H. Wang [ 王正豪 ], Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Revised: Aug 1, ECE Embedded System Design Lesson 8 Structured Programming 12/16/2015.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Introduction to OOP CPS235: Introduction.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
Systems Design. Application Design User Interface Design Database Design.
1 The Software Development Process Systems analysis Systems design Implementation Testing Documentation Evaluation Maintenance.
Problem-solving with Computers. 2Outline Computer System 5 Steps for producing a computer program Structured program and programming 3 types of.
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
Chapter 2 Principles of Programming and Software Engineering.
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.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Problem Analysis Coding Debugging Testing.
Principles of Programming & Software Engineering
Principles of Programming and Software Engineering
Designing and Debugging Batch and Interactive COBOL Programs
Unit# 9: Computer Program Development
Problem Solving Techniques
Chapter 5 - General Procedures
Chapter 5 - General Procedures
Presentation transcript:

1 5.4 Modular Design Top-Down Design Structured Programming Advantages of Structured Programming

2 Design Terminology Large problems can be broken down into smaller problems divide-and-conquer approach called stepwise refinement Stepwise refinement is part of top- down design methodology

3 Top-Down Design General problems are at the top of the design Specific tasks are near the end of the design Top-down design and structured programming are techniques to enhance programmers' productivity Top-down design aided through the use of hierarchy charts

4 Top-Down Design Criteria 1.The design should be easily readable and emphasize small module size. 2.Modules proceed from general to specific as you read down the chart. 3.The modules, as much as possible, should be single minded. That is, they should only perform a single well-defined task. 4.Modules should be as independent of each other as possible, and any relationships among modules should be specified.

5 Beginning of Hierarchy Chart Start by determining the high-level tasks

6 Detailed Hierarchy Chart Then refine the major tasks, breaking them into subtasks.

7 Structured Programming Control structures in structured programming: Sequences: Statements are executed one after another. Decisions: One of two blocks of program code is executed based on a test of a condition. Loops [iteration]: One or more statements are executed repeatedly as long as a specified condition is true.

8 Advantages of Structured Programming Goal to create correct programs that are easier to write understand m odify

9 Easy to Write Allows programmer to first focus on the big picture and take care of the details later Several programmers can work on the same program at the same time Code that can be used in many programs is said to be reusable

10 Easy to Debug Procedures can be checked individually A driver program can be set up to test modules individually before the complete program is ready. Using a driver program to test modules [or stubs] is known as stub testing.

11 Easy to Understand Interconnections of the procedures reveal the modular design of the program. The meaningful procedure names, along with relevant comments, identify the tasks performed by the modules. The meaningful procedure names help the programmer recall the purpose of each procedure.

12 Easy to Change Because a structured program is self- documenting, it can easily be deciphered by another programmer.

13 Object-Oriented Programming an encapsulation of data and code that operates on the data objects have properties, respond to methods, and raise events.

5.5 Case Study 14 Validate and input data Compute current earnings Compute total earnings to date Compute FICA tax Compute income tax withheld Compute take-home pay Display info Adjust pay by withholding allowances Withheld [single] Withheld [married] Give payroll information

5.5 Case Study 15

Case Study The major steps in the high-level task of displaying the payroll information are found in the event procedure.

Case Study Statements calling the procedures for Task 0 [validating and inputting data].

Case Study Statement calling the procedure for Task 1 [computing current earnings].

Case Study Statement calling the procedure for Task 2 [computing total earnings to date].

Case Study Statement calling the procedure for Task 3 [computing FICA tax].

Case Study Statement calling the procedure for Task 4 [computing income tax withheld].

Case Study Statement calling the procedure for Task 5 [computing take-home pay].

Case Study Statement calling the procedure for Task 5 [displaying information].

Case Study Procedures for Task 0 [validating and inputting data].

Case Study Procedure for Task 1 [computing current earnings].

Case Study Procedure for Task 2 [computing total earnings to date].

Case Study Procedure for Task 3 [computing FICA tax].

Case Study Procedure for Task 4 [computing income tax withheld]. Task 4 involves three subtasks.

Case Study Procedures for Tasks 4.2 [single withholding] and 4.3 [married withholding].

Case Study Procedure for Task 5 [computing take-home pay].

Case Study Procedure for Task 5 [displaying information].

Stub Testing A stub is an empty procedure. You can create functions or procedures with mainly just the signature and a minimum bit of code Thus, the whole calling process can be tested before testing the individual modules That way, you can incrementally build the application, one module at a time. 32

Stub Testing 33 Here, the tasks are implemented as procedure stubs. Stubs have very little code inside, mainly just the signatures.

Stub Testing 34 Note: for Function stubs, you need something for a return valuehere we just arbitrarily return 0. This program will compile, and you can test to ensure that the proper procedures are being called.

Running program outside VB.net Distribution program [not files] to others: 1 file No ability to edit Must have Microsofts.NET Framework Most computers have [it is free] Change icon Set startup form Choose the Debug/Build menu option.EXE file is Located in bin\Release folder 35

Feedback: Privacy Policy Feedback
Do Not Sell My Personal Information
About project: SlidePlayer Terms of Service

© 2021 SlidePlayer.com Inc. All rights reserved.

Video liên quan

Chủ Đề