{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Feb 28, Algortihms &acirc;€“ Part 2

Feb 28, Algortihms &acirc;€“ Part 2 - Algortihms...

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

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

View Full Document
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

{[ snackBarMessage ]}

Page1 / 9

Feb 28, Algortihms &acirc;€“ Part 2 - Algortihms...

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

View Full Document
Ask a homework question - tutors are online