Feb 28, Algortihms – Part 2

Feb 28, Algortihms – Part 2 - Algortihms...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Algortihms Part 2 28/02/2008 13:16:00 Condition Branch So far, in the method part of our algorithms, the instructions have been executed sequentially However, sometimes we need to vary the order of execution of the instructions. The order will be determined by the value of a condition We will test to determine whether the condition is true or false o If the condition is true , we will execute certain instructions o If the condition is false , we will executed other instructions But first, let us define a block as group of related instructions o A block can contain one or as many instructions as we want BLOCK 1-------------- Get X Get Y Let Z = X + Y Give Z BLOCK 2-------------- Let X = A + B * C /D Block The key feature of a block is that it has only one entrance (one way to come in) o By executing the first instruction in the block...
View Full Document

This note was uploaded on 12/08/2009 for the course TEFLER ADM1300 taught by Professor Koppel during the Fall '09 term at University of Ottawa.

Page1 / 9

Feb 28, Algortihms – Part 2 - Algortihms...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online