Unformatted text preview: m
– List the tasks to be performed – Group them into boxes according to control flow – Separate the boxes with diamonds to switch the flow • When writing C
– Set up boxes to hold the executable statements – Each ‘if’ statement produces a diamond • The boolean-expression goes in the diamond – Statement ‘inside’ the ‘if’ is below the diamond • Skipped over if false 04/29/09 R. Smith - University of St Thomas - Minnesota 12 Example
• First, let’s do the absolute value example • Next, let’s modify the rectangle example
– Accept x,y pairs – Calculate lengths even if x,y in wrong order 04/29/09 R. Smith - University of St Thomas - Minnesota 13 Final Phase of C Program Ass...
View Full Document
- Fall '08
- Control flow, Computer program, R. Smith