Presentation is loading. Please wait.

Presentation is loading. Please wait.

Higher Computing Using Loops.

Similar presentations


Presentation on theme: "Higher Computing Using Loops."— Presentation transcript:

1 Higher Computing Using Loops

2 1. Using For…Next Loop For counter = 1 to 100 Print text$ Next counter

3 2. Using For…Next Loop For counter = 2 to 20 step 2 Print counter
Next counter

4 4. Using Do…Loop Until DO (Start loop)
Display message to ask for a number Get number from keyboard If number <> 0 then Print number End if Loop Until number = 0

5 5. Using Do…Loop Until Set password to STOP DO (Start loop)
Get guess from user If guess is not equal to password then error message End if Loop Until guess = password

6 10. Using DO WHILE Set password to STOP Get guess from user
Do While guess <> password Error message Display message to ask for another guess loop

7 The FOR ………NEXT loop is a fixed loop
ie the number of times that the instructions are executed is fixed at the start of the loop. The DO………LOOP UNTIL and the DO WHILE loop are conditional loops – the number of times that the instructions are executed depends on a condition being met. The DO………LOOP UNTIL tests the condition at the end The DO WHILE tests the condition at the start


Download ppt "Higher Computing Using Loops."

Similar presentations


Ads by Google