Program design and development
1 / 21

- PowerPoint PPT Presentation

  • Updated On :

Program Design and Development. Steps In Program Development. Define the Problem Inputs, outputs, processes Outline the solution Major steps Major subtasks Major control structures (repetition loops) Major variables Mainline Logic. Steps in PD Continued. Develop Algorithm

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about '' - hija

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Steps in program development
Steps In Program Development

  • Define the Problem

    • Inputs, outputs, processes

  • Outline the solution

    • Major steps

    • Major subtasks

    • Major control structures (repetition loops)

    • Major variables

    • Mainline Logic

Steps in pd continued
Steps in PD Continued

  • Develop Algorithm

    • Using pseudocode and flowcharts

  • Test Algorithm

  • Code into programming language

  • Run complier

  • Document and maintain the program

Types of programming
Types of Programming

  • Structured/Top Down Programming

    • Starting with solution and working into more complex details

  • Modular Design

    • Grouping tasks together by function

  • Structure Theorem

    • Elimination of GOTO, replacement with IF-THEN-ELSE

Algorithm definition
Algorithm Definition

  • Lists the steps involved in accomplishing a task

  • Written in simple english and not a formal document

    • An algorithm must be

      • Lucid, precise, and unambiguous

      • Give the correct solution in all cases

      • Eventually end


  • Essentially it is structured english and formalized to look like high-level computer languages

    • Statements are written in simple english

    • Each instruction is written on a single line

    • Keywords and indentations are used to signify control structures

    • Each set of instructions is written from top to bottom with only one entry and one exit

    • Groups of statements may be formed into modules and that group given a name

Program data
Program Data

  • Variables, constants, and literals

  • Integer - 16

    • Byte length - 8

    • Short integer - 32

    • Long integer - 64

  • Real

    • Float – single precision

    • Double – double precision

  • Character

  • Boolean

Data structures
Data Structures

  • Record

  • File

  • Array

  • String

Basic computer operations
Basic Computer Operations

  • A computer can receive information

    • “READ” and “GET”

  • A computer can put out information

    • “PRINT”, “WRITE”, “PUT”, “OUTPUT”, and “DISPLAY”

  • A computer can perform arithmetic actions

    • + for ADD

    • - for SUBTRACT

    • * for MULTIPLY

    • / for DIVIDE

    • () for PARENTHESES

Basic computer options cont
Basic Computer Options Cont.

  • A computer can assign a value to a variable or memory

    • To give an initial value use “INITALISE” or “SET”

    • To assign a value use ‘=‘

    • To keep a piece of information for later use ‘SAVE’ or ‘STORE’

  • A computer can compare variables and select one of two alternative actions

    • Use of IT THEN and ELSE

    • Actually it can select multiple actions

  • A computer can repeat a group of actions


The structure theorem
The Structure Theorem

  • Sequence

    • The straightforward listing of each step

  • Selection

    • The presentation of a condition and the choice between two actions

  • Repetition

    • The presentation of a set of instructions to be performed repeatedly as long as a condition is true

Developing an algorithm
Developing An Algorithm

  • Defining the Problem

    • Input

    • Output

    • Processing

  • Use Meaningful Name

Designing an algorithm
Designing an Algorithm

  • Begin with a rough sketch of steps required to solve the problem

  • Use these requirements and structure theorem to establish how the processing will take place

  • It is important to not start coding until the necessary steps of defining the problem and designing the solution algorithm have been solved.

Checking an algorithm
Checking an Algorithm

  • Choose simple input test case

  • Establish what the expected result should be

  • Make a table of relevant variable names

  • Walk through the test case

  • Continue the process until the algorithm is correct

Selection control structures
Selection Control Structures

  • Used to illustrate a choice between two or more actions

  • Simple IF statement

  • Simple selection with null false branch (null ELSE statement)

  • Combined selection (IF/AND)

  • Nested IF Statement

    • Linear nested IF statement

The case structure
The CASE Structure

  • Another way of expressing a linear nested IF statement

  • Can often appear cumbersome

Repetition control structures
Repetition Control Structures

  • Developed because many programs require the same logic to be repeated for several sets of data.

  • Example

    • DOWHILE condition p is true

      • Statement block

    • ENDO

Dowhile loop processing
DOWHILE Loop Processing

  • The logical condition p is tested

  • If condition p is found to be true, the statements listed in the statement block will be executed once. Control is returned to the retesting of condition p.

  • If condition p is found to be false, control passes to the next statement after ENDDO and no further processing takes place within the loop.

Two important dowhile considerations
Two important DOWHILE considerations

  • Testing of the condition is done at the beginning of the loop.

  • The only way to terminate the loop is to render the DOWHILE consideration false.

Repeat until structure

  • Is the exact opposite of the DOWHILE

  • Condition is checked at the end as opposed to the beginning

  • Counted repetition

  • Question—is any method better than another?