Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 8

VB.

NET

TOPIC:MAKING DECISION
Objectives Of the lesson today :
The students should be able to:
1. Write a simple program using If-
Then and If-Then-Else statement
2. Write a simple program using
If-Then –ElseIf statement
3. Use a CheckBox and a
RadioButton control in the project
Making Decisions Using If…Then
Most common decision making
construct used is the If…Then
construct.
1. Syntax for If…Then Structure
If condition Then
…. ‘Code to execute when condition is true
End if
Proses for If….Then
2. Syntax for If…Then…Else Structure

If condition Then
… ‘Code to execute when condition is true

Else
… ‘Code to execute when condition is false

End if
Proses for If…Then…Else Structure
Using ElseIf for Advanced Decision Making
If…Then…ElseIf statement enables your
program to evaluate a second
expression when an If…Then statement
equates to False.
Syntax for If…Then…ElseIf Structure
If condition Then

ElseIf condition2 Then

ElseIf condition3 Then

Else

End If

You might also like