Sunday, May 19, 2013

Structure charts


A Structure Chart in software engineering is a chart which shows the breakdown of a system to its lowest manageable parts. They are used in structured programming to arrange program modules into a tree. Each module is represented by a box, which contains the module's name. The tree structure visualizes the relationships between modules, showing data transfer between modules using arrows. 
SymbolNameMeaning
Module
Name
ProcessEach Box represents a programming module, this might be something that calculates the average of some figures, or prints out some pay slips
CPT-Structured Chart Data Couple.svgData CoupleData being passed from module to module that needs to be processed.
CPT-Structured Chart Flag.svgFlag[Extension - you don't need to know this for the exam] Check data sent to process to stop or start processes. For example when the End of a File that is being read is reached, or a flag to say whether data sent was in the correct format
Let's take a look at a simple example of how this might be executed when representing the following code:
dim num1 as integer
dim num2 as integer
 
sub calculateAverage()
  dim avg as integer
  inputNums()
  avg = average(num1, num2)
  outputAvg(avg)
end sub
 
function average(a,b)
  return (a + b) / 2
end function
 
sub inputNums()
  num1 = console.readline()
  num2 = console.readline()
end sub
 
sub outputAvg(x)
  console.writeline("average = " & x)
end sub

No comments:

Post a Comment