Loops are used when an action is to be repeated in a program. .
IThe form below shows a picture box with the line "I like computing" repeated 10 times. This could be done by typing the same print commnand 10 times. However, using a loop would involve much less code, and it would be really easy to change the code to get the message to print 100, 1000 or even 1000000 times!
![]() |
Designing your programs! Go Full Screen to see in greater detail?
|
The For..Next loop starts with a FOR command that includes a variable to control how many times the loop is carried out. Think of this variable as a counter (why not call it counter?), because it keeps count of how many times the loop has ben carried out.
The loop ends with a simple NEXT command.
All lines of code between the FOR and the NEXT are carried out repeatedly until the required value is met in the control variable
Mark off Exercise 12 in your progress grids.
What you MAY have to do!Ask your teacher whether you should do the following task.
| Assessment 3 (A3). | Complete the assessment CAR STICKERS in your progress grids |
What you should now be able to do!