{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

20 DecisionStructures

# 20 DecisionStructures - Control Structures Selection CEE...

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

July 07 Kamal B. Rojiani 1 Control Structures: Selection CEE 3804 Computer Applications for CEE

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

View Full Document
Kamal B. Rojiani 2 Selection circle6 Program lines are executed in sequence circle6 We want to change this order of execution circle6 Select alternative computational paths circle6 Perform the same task several times
Kamal B. Rojiani 3 If /Then Statement If < condition > Then < Basic statements > EndIf circle6 condition is a logical expression that consists of two quantities to be compared and a relational operator < quantity 1 > rel oper < quantity 2 > If y < 3 Then z = y + 6 End If If z > 0 Then y = Math.Sqrt(z) End If

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

View Full Document
Kamal B. Rojiani 4 Relational Operators Operator Meaning < Less than > Greater than = Equal to <= or =< Less than or equal to >= or => Greater than or equal to <> Not equal to circle6 The result of the comparison is True or False x < 0 x + y < z x >= 0 x + y > 2 * z
Kamal B. Rojiani 5 If/Then/Else Statement If < condition > Then < true alternative statement > Else < false alternative statement > EndIf If x <= 0 Then y= a * 2.5 + 200.5 Else y = Math.Sqrt(2! * x + 6!) End If

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

View Full Document
Kamal B. Rojiani
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

20 DecisionStructures - Control Structures Selection CEE...

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

View Full Document
Ask a homework question - tutors are online