Assistanship Assistant: Denny, TE 2002 Type: not compulsary, only when necessary Duration: once a week, not more than 2 hours. Time,place: ask assistant.

Slides:



Advertisements
Similar presentations
Repetition Control Structures School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 9, Friday 3/07/2003)
Advertisements

Programming Logic and Design Fourth Edition, Introductory
ALGORITHMS THIRD YEAR BANHA UNIVERSITY FACULTY OF COMPUTERS AND INFORMATIC Lecture two Dr. Hamdy M. Mousa.
Selection control structures
1 TEL 104 / MKK Fundamental Programming: Lecture 4.
Program Design and Development
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design Copyright 2000 © John Wiley & Sons, Inc. All rights reserved. Slide 1 Key.
Chapter 2: Input, Processing, and Output
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Modularisation II Lecture 9. Communication between modules Also known as intermodule communication. The fewer and the simpler the communications, the.
EE 220 (Data Structures and Analysis of Algorithms) Instructor: Saswati Sarkar T.A. Prasanna Chaporkar, Programming.
Understanding the Mainline Logical Flow Through a Program (continued)
Repetition Control Structures
Pseudocode.
Chapter 1 Program Design
Pseudocode Algorithms Using Sequence, Selection, and Repetition.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Pseudocode.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
DCT 1123 Problem Solving & Algorithms
System Flow Charts A modeling method that analysts may use to
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Combination of Sequence, Selection and Repetition
Pseudocode algorithms using sequence, selection and repetition
DCT 1123 Problem Solving & Algorithms
Simple Program Design Third Edition A Step-by-Step Approach
Array Processing Simple Program Design Third Edition A Step-by-Step Approach 7.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
First Steps in Modularization Simple Program Design Third Edition A Step-by-Step Approach 8.
 Once the system has been installed it will be monitored to check whether it is working correctly. Sometimes problems with a system will not be found.
Selection Control Structures Simple Program Design Third Edition A Step-by-Step Approach 4.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Developing an Algorithm
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
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.
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
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.
Cosc175/module.ppt1 Introduction to Modularity Function/procedures void/value-returning Arguments/parameters Formal arguments/actual arguments Pass by.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Motivation Complexity of programming problem  more difficult to consider the solution as a whole  clue: dividing the problem into small parts (module)
Computer Programming CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming.
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.
Flowcharts. Symbol Terminal Symbol: indicates the starting or stopping pointin the logic. Input/Output Symbol: Represents an input or output process in.
Flowcharts Lecture 12.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Array Applications. Objectives Design an algorithm to load values into a table. Design an algorithm that searches a table using a sequential search. Design.
 Problem Analysis  Coding  Debugging  Testing.
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
A451 Theory – 7 Programming 7A, B - Algorithms.
Software Design Principles
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 2: Input, Processing, and Output
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.
Designing and Debugging Batch and Interactive COBOL Programs
Pseudocode algorithms using sequence, selection and repetition
Chapter 2: Input, Processing, and Output
Chapter 2. Problem Solving and Software Engineering
Basic Concepts of Algorithm
Assistanship Assistant : Denny, TE 2002
Presentation transcript:

Assistanship Assistant: Denny, TE 2002 Type: not compulsary, only when necessary Duration: once a week, not more than 2 hours. Time,place: ask assistant Registration: send to:

Web address for course material

Modularisation Lecture 8

Motivation Complexity of programming problem  more difficult to consider the solution as a whole  clue: dividing the problem into small parts (module) Each module represent single task, free of error Modularisation : is the process of dividing a problem into separate tasks, each with a single purpose.

Benefits of modular design Ease of understanding  each module has only one function Reusable code Elimination of redundancy  avoid the repetition of writing Efficiency of maintenance

Modular name convention Describe the work to be done as a single specific function Use a verb, followed by a two-word object. Example: –Print_page_heading –Calculate_sales_tax –Validate_input_date

Example 8.1 Design a solution algorithm that will prompt a terminal operator for three characters, accept those characters as input, sort them into ascending sequence and output them to the screen. The algorithm is to continue to read characters until ´XXX´is entered.

Defining diagram InputProcessingOutput Char_1 Char_2 Char_3 Prompt for characters Accept three characters Sort three characters Ouput three characters Char_1 Char_2 Char_3

Original Solution algorithm Process_three_characters Prompt the operator for char_1, char_2, char_3 Get char_1, char_2, char_3 DOWHILE NOT (char_1=´X`AND char_2=´X´AND char_3=´X´) IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF IF char_2>char_3 THEN temp = char_2 char_2 = char_3 char_3 = temp ENDIF IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF Output to the screen char_1, char_2, char_3 Prompt operator for char_1, char_2, char_3 Get char_1, char_2, char_3 ENDDO END

Solution Algorithm using a module Process_three_characters Prompt the operator for char_1,char_2,char_3 Get char_1, char_2, char_3 DOWHILE NOT (char_1=´X`AND char_2=´X´AND char_3=´X´) Sort_three_characters Output to the screen char_1,char_2,char_3 Prompt operator for char_1, char_2, char_3 Get char_1,char_2,char_3 ENDDO END Sort_three_characters IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF IF char_2>char_3 THEN temp = char_2 char_2 = char_3 char_3 = temp ENDIF IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF END ´Controlling module´or ´Calling module´or ´Mainline“ `Subordinate module` or `Called Module`

Hierarchy charts or structure charts or visual table of content President Vice_president Sales Vice_president Finance Vice_president Personnel Manager FManager EManager DManager CManager BManager A

Hierarchy Chart Example 8.1 Process_three_ characters Sort_three_ characters Calling module Called module

Example 8.2 Process three characters Design a solution algorithm that will prompt a terminal operator for three characters, accept those characters as input, sort them into ascending sequence and output them to the screen. The algorithm is to continue to read characters until ´XXX´is entered.

Defining diagram InputProcessingOutput Char_1 Char_2 Char_3 Prompt for characters Accept three characters Sort three characters Ouput three characters Char_1 Char_2 Char_3

Solution Algorithm Process_three_characters Read_three_characters DOWHILE NOT (char_1=´X`AND char_2=´X´AND char_3=´X´) Sort_three_characters Print_three_characters Read_three_characters ENDDO END Read_three_characters Prompt the operator for char_1,char_2,char_3 Get char_1, char_2, char_3 END Sort_three_characters IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF IF char_2>char_3 THEN temp = char_2 char_2 = char_3 char_3 = temp ENDIF IF char_1>char_2 THEN temp = char_1 char_1 = char_2 char_2 = temp ENDIF END Print_three_characters Output to the screen char_1, char_2, char_3 END Mainline 1rst Module 2nd Module 3rd Module

Hierarchy charts Process_three_ characters Read_three_ characters Sort_three_ characters Print_three_ characters