Presentation is loading. Please wait.

Presentation is loading. Please wait.

Control Structures in VB

Similar presentations


Presentation on theme: "Control Structures in VB"— Presentation transcript:

1 Control Structures in VB
Dr. John Abraham Professor, UTPA

2 Sequential vs Selection
Program Counter Transfer of control Goto unstructured Structured: sequence, selection and repetiton

3 Selection If..then If grade >= 60 then write(“Passed”) else
write (“Failed”) End If

4 Nested selection If grade >= 90 then write(“A”) Else
write(“B”) if grade >= 70 then write(“C”) write(“F”) End If

5 Alternative version If grade >=90 then write (“A”)
ElseIf grade >=80 then write(“B”) ElseIf grade >= 70 then write(“C”) Else write(“D”) End If

6 Select Case Select Case Grade Case 100 statements Case 90 to 99
Case Else End Select

7 Repetition chapters 5 & 6 While – End While Do While – Loop
Do Until – Loop For – Next Do – Loop While Do – Loop Until See example programs

8 While – End While Select a loop control variable (example grade)
Initialize that variable (either read or assign) Set up loop like this While grade <= 100 Grade = console.readline() End while

9 Assignment3 Explained


Download ppt "Control Structures in VB"

Similar presentations


Ads by Google