Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. Computer Programming 1
  2. Essential Standard 5.05 Apply Looping Structures
  3.  
  4.  
  5. Anatomy of a Looping Structure
  6.  
  7. Syntax of Do...Loop While Syntax of For…Next Loop
  8.  
  9. Do For intVariable = intStart To intEnd Step intAmt
  10. Statements Statements
  11. Loop While(Boolean Condition) Next intVariable
  12.  
  13. **Step is optional
  14. Syntax of Do While...Loop
  15.  
  16. Do While(Boolean Condition)
  17. Statements
  18. Loop
  19.  
  20.  
  21. Practice the Decision Structure
  22.  
  23. Write the appropriate loop for each expression.
  24.  
  25. 1. Write a For…Next loop that will start at 0 and end at 10 counting by 2.
  26. For 0 To 10 Step 2
  27. Next
  28. 2. Write a For…Next loop that will start count backwards from 10 to 1.
  29. For 10 to 1 Step -1
  30. Next
  31. 3. Write a Do While loop that will loop until the user enters -1.
  32. Do While intInputbox <> -1
  33. Loop
  34. 4. Write a Do...Loop While that will loop until the user enters “Stop”.
  35. Do While strInputbox <> “Stop”
  36. Loop
  37. 5. Write a Do While loop that will loop until the intNum is 10 when intNum starts at 1.
  38. intNum = 1
  39. Do While intNum < 10
  40. intNum = intNum + 1
  41. Loop
  42. 6. Write a Do. Loop While loop that will loop until the intNum is 10 when intNum starts at 1.
  43. intNum = 1
  44. Do
  45. intNum = intNum + 1
  46. Loop While intNum < 10
  47. Find the Errors & Rewrite
  48.  
  49. Find the syntax or logic error. Rewrite the code correctly.
  50.  
  51. 7. intNum = 0
  52. Do While (intNum < 10)
  53. intNum +=1
  54. Loop
  55.  
  56. 8. For intNum As Integer = 10 to 0 Step -1
  57. Next intNum
  58.  
  59. 9. intNum = 1
  60. Do While (intNum < 10)
  61. intNum +=1
  62. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement