Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Computer Programming 1
- Essential Standard 5.05 Apply Looping Structures
- Anatomy of a Looping Structure
- Syntax of Do...Loop While Syntax of For…Next Loop
- Do For intVariable = intStart To intEnd Step intAmt
- Statements Statements
- Loop While(Boolean Condition) Next intVariable
- **Step is optional
- Syntax of Do While...Loop
- Do While(Boolean Condition)
- Statements
- Loop
- Practice the Decision Structure
- Write the appropriate loop for each expression.
- 1. Write a For…Next loop that will start at 0 and end at 10 counting by 2.
- For 0 To 10 Step 2
- Next
- 2. Write a For…Next loop that will start count backwards from 10 to 1.
- For 10 to 1 Step -1
- Next
- 3. Write a Do While loop that will loop until the user enters -1.
- Do While intInputbox <> -1
- Loop
- 4. Write a Do...Loop While that will loop until the user enters “Stop”.
- Do While strInputbox <> “Stop”
- Loop
- 5. Write a Do While loop that will loop until the intNum is 10 when intNum starts at 1.
- intNum = 1
- Do While intNum < 10
- intNum = intNum + 1
- Loop
- 6. Write a Do. Loop While loop that will loop until the intNum is 10 when intNum starts at 1.
- intNum = 1
- Do
- intNum = intNum + 1
- Loop While intNum < 10
- Find the Errors & Rewrite
- Find the syntax or logic error. Rewrite the code correctly.
- 7. intNum = 0
- Do While (intNum < 10)
- intNum +=1
- Loop
- 8. For intNum As Integer = 10 to 0 Step -1
- Next intNum
- 9. intNum = 1
- Do While (intNum < 10)
- intNum +=1
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement