unit 6 - software design and development lesson 11 flow...
TRANSCRIPT
LESSON 11– FLOW-CHARTS AND PSEUDOCODE
Unit 6 - Software Design and Development
Previously
Key features of programming languages
Software Development Lifecycle
Using tools to demonstrate software design Inputs and outputs
GUI design with storyboards
Design constraints.
Tools. Data flow diagrams.
Structure diagrams.
Entity relationship models
What is covered in this session Flow diagrams
Pseudocode
flowcharts
Flowcharts
a tool for analysing processes.
allows any process to be: broken down into individual events or activities
to display these in shorthand form
shows the logical relationships between them.
Constructing flowcharts promotes: better understanding of processes,
better understanding of processes is a pre-requisite for improvement.
http://www.hci.com.au/flowcharting-a/
Flowcharts – basic symbols
start
end
Decision?
process
connector
Flowcharts – basic symbols
Off page connector
Data storage
display
Predefined process
display
Flow charting – basic rules
are written top to bottom.
can exit to the right
can enter from the left.
Page connectors are used when more than one page is required.
Arrows are used to show the flow.
Flow charting – example task 29
Part of the requirements for assignment 3 are: The decorator needs to enter the height of the room
(assume all walls are the same height i.e. no sloping ceilings).
The height must be between 2.4m and 6m.
The length of all four walls must be entered (minimum 1m and maximum 25m).
Produce a flowchart for this requirement.
For assignment 3 this flowchart will need to be extended to include the calculations and output.
Pseudo code
provides a design technique which is very close to the code that will eventually be written.
It’s a kind of ‘halfway house’ between the high level generalised techniques like structured diagrams and low level details that are required in the actual code.
useful for working out how complex algorithms (mathematical formulae) will be written in program code.
Pseudo code - indenting
The rules are reasonably straightforward.
All statements showing "dependency" are to be indented.
These include while, do, for, if, switch. .
Pseudo code – keywords
For looping and selection, the keywords that are to be used include Do While...EndDo; Do Until...Enddo; Case...EndCase; If...Endif; Call ... with (parameters); Call; Return ....; When; Always use scope terminators for loops and iteration, even though Python does not use them.
Pseudo code – keywords
• As verbs, use the words:
• Generate,
• Compute,
• Process, etc.
• Words such as
• set, reset, increment, compute, calculate, add,
sum, multiply, ... print, display, input, output, edit,
test , etc.
• with careful indentation tend to foster desirable
pseudo code.
• Do not include data declarations in your pseudo
code.
Pseudo code - example
Dim Num1 As Integer Dim Num2 As Integer Num1 = Text1.Text Num2 = Text2.Text If Num1 > Num2 Then MsgBox "Num1 is Greater than Num2" If Num1 < Num2 Then MsgBox "Num2 is Greater than Num1" If Num1 = Num2 Then MsgBox "Num1 and Num2 are equal"
Make Num1 as the text in Text1 Make Num2 as the text in Text2 if Num1 is greater than Num2 then "Num1 is greater than Num2" else if Num1 is smaller than Num2 then "Num2 is Greater then Num1" else if Num1 is equal to Num2 then "Num1 and Num2 are equal"
Pseudo code Task 30
Using the scenario in A3
Develop an algorithm using pseudo-code to describe how the calculation should be done to estimate the cost of decorating for:
any given size of room,
choice of paint
undercoat.
Assignment 3: submit to TurnitinL3U06A3PeterPan2017
Design the program.
Use at least two design tools (flow chart, structure diagram, DFD diagram or ERD diagram) to identify the different procedures in the program.
Do not use pseudo-code for this task.
Show a storyboard for the design. Explain any differences from the final layout (actual program).
Assignment 3: submit to TurnitinL3U06A3PeterPan2016
Now develop the program. The following will need to be demonstrated: A well designed interface Choice of paint quality Window area calculation Working calculation to determine the area
to be painted Bill including:
total and invoice number
Assignment 3: submit to TurnitinL3U06A3PeterPan2016
As part of the company’s procedures, all design work needs to be documented. Write a justification of the data types and software structures chosen. Consider the variables defined in the design (explain WHY
particular data types were chosen, WHAT the alternatives were and WHY these were not considered suitable. In some cases this will be obvious i.e. a text input box.)
the way the system has been structured; by splitting it into a number of different procedures, for example.
Assignment 3: submit to TurnitinL3U06A3PeterPan2016
Develop an algorithm, using pseudo-code, to describe how the calculation should be done to estimate the cost of decorating for any given size of room, choice of paint and undercoat. (The algorithms produced should be annotated to explain how they work and how they meet the requirements of the system).
Summary
Flow charts
Pseudo code
A3