Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School 2009 1 Unit 2 Software Development Process Topic.

Slides:



Advertisements
Similar presentations
Modular Design Using Subroutines (functions later)
Advertisements

User Defined Functions
Software development process. Explanation of the iterative nature of the software development process.
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
What is Software Design?  Introduction  Software design consists of two components, modular design and packaging.  Modular design is the decomposition.
Chapter 4 General Procedures
Creating Packages. 2 home back first prev next last What Will I Learn? Describe the reasons for using a package Describe the two components of a package:
CS 201 Functions Debzani Deb.
Top-Down Design with Functions 4 What do programmer’s (not programs!) use as input to the design of a program? –Documentation Problem definition Requirements.
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.
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
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)
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Apply Sub Procedures/Methods and User Defined Functions
Benefits of PL/SQL. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –List and explain the benefits of PL/SQL –List.
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
Structured Programming Defn: This is an approach to program development that produces programs of high quality that are easy to test, debug, modify and.
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
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.
Higher Grade Computing Studies 2. Languages and Environments Higher Computing Software Development S. McCrossan 1 Classification of Languages 1. Procedural.
Top-Down Design and Modular Development
Modular Programming. Modular Programming (1/6) Modular programming  Goes hand-in-hand with stepwise refinement and incremental development  Makes the.
CS0004: Introduction to Programming Subprocedures and Modular Design.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
ENG 1181 College of Engineering Engineering Education Innovation Center P. 1 1 Computer Problem Solving in MATLAB Topics Covered: 1.Problem Solving 2.Top-Down.
Computer Science: A Structured Programming Approach Using C1 4-6 Scope Scope determines the region of the program in which a defined object is visible.
Chapter 7 Software Engineering Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Introduction to Method. Example Java Method ( 1 ) The 2 types (kinds) of methods in Java Class methods Instance methods Methods can do more work than.
Functions Top-down design Breaking a complex problem into smaller parts that we can understand is a common practice. The process of subdividing a problem.
Prog. techniques. Standard prog. techniques Complex programs can be broken down into simpler parts called “Modules” These come in 2 types,“Procedures”
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Sub Procedures. A Sub procedure is a block of code that is executed in response to an event. There are two types of Sub procedures, general procedures.
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
Chapter One An Introduction to Programming and Visual Basic.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Java Programming, 2E Introductory Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
1 Objectives ❏ To design and implement programs with more than one function ❏ To be able to design multi-function programs ❏ To understand the purpose.
Choosing the write programming language for the job. The choice of language may be based on: The experience and expertise of the development team. The.
Top-down approach / Stepwise Refinement & Procedures & Functions.
1 MODULAR DESIGN AND ABSTRACTION. 2 SPECIFYING THE DETAILS OF A PROBLEM INTO A RELATED SET OF SMALLER PROBLEMS.
Topic 4 - Database Design Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Functions  A Function is a self contained block of one or more statements or a sub program which is designed for a particular task is called functions.
04/02/ Procedures Top-down approach / Stepwise Refinement & Sub Procedures.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
JavaScript Modularity. Goals By the end of this lecture, you should … Understand why programmers use modularity. Understand how to create a function in.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Structured Programming
COMPUTATIONAL CONSTRUCTS
Functions Review.
Functions and Procedures
Starting Out with Programming Logic & Design
Chapter 4 - Visual Basic Schneider
Problem Solving Techniques
Structured Programming
Functions and Procedures
Topics discussed in this section:
Chapter One: An Introduction to Programming and Visual Basic
Starting Out with Programming Logic & Design
Software development process
CPS125.
Top-Down Design with Functions
Introducing Modularity
Presentation transcript:

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Unit 2 Software Development Process Topic 8 Languages and Environments

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Modularity You refine a complex program by progressively breaking it down into smaller, easier-to solve units (top-down design with step-wise refinement). Each of these units, called modules, can be independently coded in a high level language and then amalgamated to form the complete program. The use of structure charts emphasize this modular design and also the relationship between all the modules in the software system. The programs that you will be writing in Visual Basic will be relatively short and you might not see the need to use modular techniques. Visual Basic is an events-driven programming language, programming is done in a graphical environment. Users can click on various objects where each object is programmed independently to be able to respond to user actions. A Visual Basic program is, therefore modular being made up of many subprograms, each having its own program code that can be executed independently. These subprograms are called procedures and functions.

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Modularity Procedures and functions provide a means of producing structured programs. The more complex a program becomes the more reason to employ strategies to make it easier to read and maintain. Procedures and functions help by breaking the extensive lines of code into small, meaningful sections. As a consequence: repetition of lines of code is avoided - code is placed in a procedure or function. The procedure is then called as many times as necessary without re-writing the code; it allows testing of the procedure code to take place in isolation from the main program. debugging main body of the program is simplified as each procedure is individually tested; procedure code can be saved and re-used in future projects. Eg Module libraries -repositories for useful modules that are pre-tested and documented.

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Procedures and Functions Procedures and functions allow strategies to be employed to make it easier to read and maintain code. Procedures and functions break up what would be extensive lines of intricate code into more meaningful and logical sections. As a consequence: the repetition of lines of code are avoided by placing code in a procedure or function. Call the procedure or function as often as necessary. it allows testing of each procedure individually. debugging of entire code is simplified since each procedure has been individually tested procedure code can be saved and re-used in Module libraries. A procedure or function is activated by a call from the main program, after which the procedure or function executes its block of code and then terminates. The flow of data between procedures, functions and the main program block is accomplished by the use of parameters, which will be discussed later.

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Procedures and Functions Procedures Visual Basic offers a variety of procedure types. The two that concern us here are: Up to now most of all the programming code you have seen has been made up of event procedures that activate sections of code when, say a command button is pressed. These procedures are named by Visual Basic by concatenating the name of the object code and the name of the event according to the syntax: Sub Command_Click() End End Sub You will recognise this code which ends a Visual Basic program. event procedures general procedures.

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Procedures and Functions General Procedures A general procedure, unlike an event procedure is user-defined with its block of code being called from the main program. The basic structure for a procedure is Sub procedure_name (formal parameters) Declarations Statements End Sub The name, procedure_name or identifier, is what is used when the procedure is called and the name conforms to the same rules of naming variables. Data is passed to and from the main program using the procedure parameters. Not all procedures however need to have parameters. The declarations and statements follow an identical pattern to normal programming constructs. Procedures are normally declared private and their scope is limited to other procedures and variables within the current form.

Computing Higher – SD Unit - Topic 8 – Procedure and Standard Algorithms P Lynch, St Andrew’s High School Procedures and Functions Parameter passing Parameter passing is the main mechanism for transferring information between programs and sub procedures in Visual Basic. Parameters can be classified into various types, depending on how they deal with data values during a procedure call. Other than using global variables, parameter passing using local variables is the way in which information is transmitted to and/or from called procedures in a program. The formal parameters can behave in one of three ways: 1.They can pass information to a sub program 2.They can receive information from a sub program 3.They can both send and receive information. These three methods are described as: 1.IN mode or use of an IN parameter 2.OUT mode or use of an OUT parameter 3.IN/OUT mode or use of an IN/OUT parameter.