
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















Unit 1 Fundamentals of programming
Objectives
Unit 1 Fundamentals of programming WHILE … ENDWHILE loop
WHILE Condition x = True Execute statement a Execute statement b etc.... END WHILE
Unit 1 Fundamentals of programming Iteration entry condition
x 0 WHILE x < 2 x x+ OUTPUT x ENDWHILE OUTPUT “The end” x Output 0
Unit 1 Fundamentals of programming Worksheet 3
Unit 1 Fundamentals of programming REPEAT .. UNTIL loop
x 0 Repeat x x+ OUTPUT x UNTIL x >= 2 OUTPUT “The end” x Output 0
Unit 1 Fundamentals of programming Performing a range check
OUTPUT “Enter age” age USERINPUT UNTIL age > 11 AND age <= 18 OUTPUT “Age is”, age
Unit 1 Fundamentals of programming An equivalent WHILE loop
age = 0 WHILE age < 12 OR age > 18 OUTPUT “Enter age” age USERINPUT ENDWHILE OUTPUT “Age is”, age
Unit 1 Fundamentals of programming Infinite loop
Unit 1 Fundamentals of programming Infinite loops in control and data sensing applications
Unit 1 Fundamentals of programming FOR .. NEXT loop
Unit 1 Fundamentals of programming FOR .. NEXT loop
Unit 1 Fundamentals of programming Stepping backwards
Unit 1 Fundamentals of programming Using a WHILE .. ENDWHILE loop as an alternative
index 1 WHILE index < 4 OUTPUT index index index + 1 ENDWHILE FOR index 1 to? OUTPUT index NEXT index