Pemrograman VisualMinggu …4… Page 1 MINGGU Ke Empat Pemrograman Visual Pokok Bahasan: Control Statement I Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan dan mengaplikasikan konsep control statement I pada Visual Basic 2008 Referensi: Deitel Deitel, Visual Basic 2008 (2009), How to Program, Prentice Hall. Chapter 5
Pemrograman VisualMinggu …4… Page 2 Agenda If … Then Selection Statement If … Then … Else Selection Statement While Repetition Statement Do While … Loop Repetition Statement Do Until … Loop Repetition Statement Compound Assignment Operators Nested Control Statement Nested Repetition Statement
Pemrograman VisualMinggu …4… Page 3 If/Then Selection Structure grade>=60 Console.writeLine(“Passed”) If studentGrade>=60 Then Console.WriteLine(“Passed”) End If True False
Pemrograman VisualMinggu …4… Page 4 If/Then/Else Selection Structure grade>=60 Console.writeLine(“P assed”) If studentGrade>=60 Then Console.WriteLine(“Passed”) Else Console.WriteLine(“Failed”) End If Console.writeLine(“ Failed) TrueFalse
Pemrograman VisualMinggu …4… Page 5 While Repetition Structure Product<=1000 Product=Product*2 Dim Product as Integer=2 While Product<=1000 Console.Write(“{0}”, Product) Product=Product*2 End While True False
Pemrograman VisualMinggu …4… Page 6 Do While/Loop Repetition Structure Product<=1000 Product=Product*2 Dim Product as Integer=2 Do While Product<=1000 Console.Write(“{0}”, Product) Product=Product*2 End While True False
Pemrograman VisualMinggu …4… Page 7 Do Until/Loop Repetition Structure Product > 1000 Product=Product*2 Dim Product as Integer=2 Do Until Product > 1000 Console.Write(“{0}”, Product) Product=Product*2 End While False True
Pemrograman VisualMinggu …4… Page 8 Demo While Statement
Pemrograman VisualMinggu …4… Page 9 Demo Do While
Pemrograman VisualMinggu …4… Page 10 Demo Do Until
Pemrograman VisualMinggu …4… Page 11 Compound Assignment Operator Visual Basic provides the compound assignment operator for abbreviating assignment statements eq. +=, -=, *=, /=, \=, ^= and &=
Pemrograman VisualMinggu …4… Page 12 Nested Control Statement
Pemrograman VisualMinggu …4… Page 13 Test Program for Class Analysis
Pemrograman VisualMinggu …4… Page 14 Nested Repetition Statement
Pemrograman VisualMinggu …4… Page 15 Questions & Answers
Pemrograman VisualMinggu …4… Page 16 Thank You