Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Code Design (The use of pseudo code for Elementary Process Descriptions)

Slides:



Advertisements
Similar presentations
Chapter 11 Describing Process Specifications and Structured Decisions
Advertisements

Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Selection (decision) control structure Learning objective
ITEC113 Algorithms and Programming Techniques
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
System Concepts for Process Modeling  Process Concepts  Process Logic  Decomposition diagrams and data flow diagrams will prove very effective tools.
Structured English. From user-speak to programming User Structured English Analyst Programs Programmer Plain English Pseudocode.
Chapter 9 Describing Process Specifications and Structured Decisions
Chapter 9 Describing Process Specifications and Structured Decisions Systems Analysis and Design Kendall & Kendall Sixth Edition © 2005 Pearson Prentice.
Chapter 9 Describing Process Specifications and Structured Decisions
Program Design and Development
Kendall & KendallCopyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall 9 Kendall & Kendall Systems Analysis and Design, 9e Process Specifications.
Pseudocode.
Adding Automated Functionality to Office Applications.
Fundamentals of C programming
Kendall & KendallCopyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall 9 Kendall & Kendall Systems Analysis and Design, 9e Process Specifications.
ALGORITHMS AND FLOWCHARTS
DCT 1123 Problem Solving & Algorithms
System Implementation System Implementation - Mr. Ahmad Al-Ghoul System Analysis and Design.
Chapter 9 Describing Process Specifications and Structured Decisions
CIS Computer Programming Logic
The Structured Specification. Why a Structured Specification? System analyst communicates the user requirements to the designer with a document called.
Chapter 11 Describing Process Specifications and Structured Decisions Systems Analysis and Design Kendall and Kendall Fifth Edition.
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Input, Output, and Processing
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
1 Boolean Expressions to Make Comparisons Boolean expression –Represents only one of two states –Expression evaluates to either true or false Expressions.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
4. The process specification (プロセス仕様) You will learn: (次の内容を学び) The concept of process specification (プロセス 仕様の概念) Notations for process specification (プロセス.
Visual Basic Programming
ITEC113 Algorithms and Programming Techniques
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Basic Control Structures
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Algorithm Design.
© ABB University - 1 Revision C E x t e n d e d A u t o m a t i o n S y s t e m x A Chapter 11 Structured Text Course T314.
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
Program Development C# Programming January 30, 2007 Professor J. Sciame.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Copyright © 2011 Pearson Education Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall & Kendall Global Edition 9.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
 Problem Analysis  Coding  Debugging  Testing.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
Process Specifications and Structured Decisions
GC211Data Structure Lecture2 Sara Alhajjam.
The Selection Structure
Introduction To Flowcharting
ALGORITHMS AND FLOWCHARTS
Program Design Introduction to Computer Programming By:
ALGORITHMS AND FLOWCHARTS
Introduction to Algorithms and Programming
Describing Process Specifications and Structured Decisions
Introduction to Algorithms - 1
Understanding Problems and how to Solve them by using Computers
Chapter 11 Describing Process Specifications and Structured Decisions
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Chapter 4: Boolean Expressions, Making Decisions, and Disk Input and Output Prof. Salim Arfaoui.
Presentation transcript:

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Code Design (The use of pseudo code for Elementary Process Descriptions)

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing What are mini specifications? A process descriptor provides a detailed explanation of the internal processing policy of a functional primitive that transforms input data into output data

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Documenting a process Various means and tools include l pseudo code (structured English) l decision trees l decision tables l action diagrams l mathematical algorithms

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Documenting the policy Need only specify the processing policies necessary to transform data or simply provide data. When stating policy, only specify what rather than how with regard to processing data. Try to specify data transformations from the user’s vantage point.

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing A process descriptor... l must exist for every functional primitive in a DFD l must state the ways in which data flowing into the process are transformed into output flows l must state the policy that governs the transformation, not the method to do so l should seek to control redundancy l should use a small set of constructs

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Additional process descriptor information As well as logic the process descriptor should mention l processor requirements l security requirements l time requirements l processing requirements l performance requirements l safety requirements

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Specifying logic (1) Sequence Repetition AB A A Do WhileRepeat Until

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Specifying logic (2) Selection A A B A CB IFIF THEN ELSECASE

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Pseudo code/structured English Programming Design Language (PDL) by Caine and Gordon, a ‘pidgin’ language that uses the vocabulary of one language (i.e. English) and the overall syntax of another (i.e. a structured programming language) Tom DeMarco defines structured English as a specification language that uses a limited vocabulary and a limited syntax

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Structured English vocabulary The vocabulary consists of l imperative English-language verbs l terms defined in the data dictionary l certain reserved words for logic formulation The structured English minimal set can now be defined

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Syntax and variables l Data flows, data stores, common processing routines: upper case hyphenated words (define in data dictionary) l Local variables: upper case hyphenated words (do not define in data dictionary) l Commands, primitive functions, sources/sinks: lower case first letter capitalised l Prepositions/verbs: lower case

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Assignment statements Assign values to single variables with VARIABLE = Value / Literal / Expression VARIABLE Value / Literal / Expression Set VARIABLE to Value / Literal / Expression Compute VARIABLE = Expression

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Operators (1) Arithmetic expressions l Results are numeric l Operators are:addition (+) subtraction (-) multiplication (*) division (/) exponentiation (**)

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Operators (2) Boolean expressions l Results are either True or False l Logical operators And, Or and Not l Relational operators:less than (<) less than or equal (<=) equal (=) not equal ( ) greater than (>) greater than or equal (>=)

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Sequence of execution All commands are intended to be executed in a forward sequential order as written unless the logic or command indicates otherwise. It is helpful to establish indentation rules to help identify computational units.

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Repetition statements (1) Do While statement While condition Do : statements : EndWhile condition statements False True

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Repetition statements (2) Repeat Until statement Repeat : statements : Until condition condition statements True False

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Decision statements If...Then...Else If condition then : statements1 : else : statements2 : endif condition statements1 statements2 True False

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Input/output statements Various ways of designating flow of data into and out of a functional primitive process are acceptable InputOutput AcceptSend GetPut ReadWrite or Print

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing File manipulation These commands not absolutely necessary Create data-entry in data-store-name Delete data-entry from data-store-name Search data-store-name for condition Locate data-element(s) in data-store-name for condition Match data-element-1 to data-element-2 in data-store- name Merge data-store-name-1 into data-store-name-2

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Case statements Allows several alternative sets of processing logic to be distinguished without the need for multiple If..Then..Else statements Case 1 (condition) statements1 Endcase 1 Case 2 (condition) statements2 Endcase 2 : Else statements (n+1) Endcases

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Common processing routines (1) l Defined in the data dictionary l Can be called more than once in the system l CALL statement lists the parameters needed by the called process to perform its tasks. l The calling process receives the output data elements from the called routine CALL common-processing-routine-name (parameter list)

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Common processing routines (2) Validate currency exchange Calculate commission fee Calculate currency value Determine current exchange rate Currency Type Exchange Rate Currency details Converted currency Exchange request Total currency

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Common processing routines (2) Calculate Currency Exchangedescriptor Input Currency details from Validate currency exchange : Call Determine current exchange rate (Currency Type, Exchange Rate) Multiply Currency Value by Exchange Rate : Output Total currency to Calculate commission fee Stop

Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing Suspension, termination & comments It may be necessary at times to halt processing temporarily: –to allow a passage of time Output Request-For-Info-Msg to Customer WAIT Input Customer-Info from Customer –to wait to be reactivated by another process Output Customer-Rec to Master-File WAIT