120 likes | 297 Views
CN2180 Chapter 6. Kemtis Kunanuraksapong MSIS with Distinction, A+. Agenda. Looping Logic Exercise Assignment The Guess a Number Game Quiz. Looping Logic Statements. For… Next For…Each… Next Do…while Do…Until While…Wend. For…Next Statement.
E N D
CN2180Chapter 6 KemtisKunanuraksapong MSIS with Distinction, A+
Agenda • Looping Logic • Exercise • Assignment • The Guess a Number Game • Quiz
Looping Logic Statements • For… Next • For…Each… Next • Do…while • Do…Until • While…Wend
For…Next Statement For counter = begin To end [Step StepValue] Statements Next See code on Page 152 Exit For See code on Page 153
For Each…Next Statement For Each element In collection Statements Next See code on Page 154
Exercise 1 • Write a script using for…next statement • Set the title name constant to “For…next example” • Collect Input (place) from user. Use for… next statement to ask 6 places. • Use massage box to show the list of answers
Do…While Do While condition Statements Loop
Do…While (Cont.) Do Statements Loop While condition See code on Page 156 and 167 Endless loop -- Exit Do
Do…Until Do Until condition Statements Loop See code on Page 159
While…Wend While condition Statements Wend See code on Page 160
Guess a Number Game See Page 161
Assignment • See Page 173 • Do Challenge 2 first then • Challenge 1