Tuesday, February 25, 2014

Steps in Programming

Steps in Programming

  • Every programming task have two phase
    • Design phase
    • Implementation phase 
  • Design phase
    • Identifies the problem and defines the steps “how to obtain the solution ” 
    • Algorithm -A Set of instructions (steps) to obtain a solution for a computational problem 
  • Implementation phase 
    • Implement the designed algorithm (procedure) in selected programming language
Flow Chart

  • A graphical representation of steps of a procedure (computer program)
  • Made up of rectangles, diamonds and other shapes connected with arrows
  • Arrows indicate the flow of the procedure
Flow Chart : Symbols
Flow Chart : Rules
  • All symbols of the flowchart are connected by flow lines (note arrows, not lines) 
  • Flow lines enter the top of the symbol and exit out the bottom, except for the Decision symbol, which can have flow lines exiting from the bottom or the sides
  • Generally flow charts flow from top to bottom 
  • The beginning and the end of the flowchart is indicated using the Terminal 
  • Connectors are used to connect breaks in flow chart
Pseudo Code
  • Pseudo code is an informal language that helps programmers develop and represent algorithms
  • Very similar to everyday English
  • Can not be executed in a Computer
  • However, a carefully prepared Pseudo code can be easily implemented in a programming language

Example 
  • A Pseudo code of an algorithm to calculate and display the average of two integer number given by the user
  • Steps
    • Declare and initialize variables
    • Input values for variable
    • Calculation 
    • Display the result
Answer




No comments:

Post a Comment