Download presentation
Presentation is loading. Please wait.
Published byLiani Tan Modified over 5 years ago
1
Learning Intention I will learn about selection with multiple conditions.
2
Analysis Design Implementation Testing Documentation Evaluation
3
Multiple Condition Selection
so far the programs you have created with conditions have had either one (IF) or two (IF and ELSE) possible outcomes sometimes our programs need to work for a number of different options
4
Multiple Condition Selection
what is wrong with the following? e.g. deciding education level IF age >= 11 THEN SEND “secondary” TO DISPLAY ELSE SEND “primary” TO DISPLAY END IF
5
Multiple Condition Selection
In addition to IF … ELSE … END IF we can also use ELSE IF to test multiple conditions
6
Multiple Condition Selection
Pseudocode: IF age >= 17 THEN SEND “college/uni/job” TO DISPLAY ELSE IF age >= 11 THEN SEND “secondary school” TO DISPLAY ELSE IF age >= 4 THEN SEND “primary school” TO DISPLAY ELSE SEND “nursery” TO DISPLAY END IF
7
Multiple Condition Selection
Be careful - only the first TRUE condition met will have the code inside it run
8
Multiple Condition Selection
What is wrong with this? IF age >= 4 THEN SEND “school” TO DISPLAY ELSE IF age >= 17 THEN SEND “college/uni/job” TO DISPLAY ELSE SEND “nursery” TO DISPLAY END IF age = 12 age = 22
9
Programming Tasks Complete the tasks on pages 47 -> 48
Write the pseudocode design for tasks 2 and 3 as code comments before programming each one. Get your teacher to check them before coding.
10
Success Criteria I can make a program branch in multiple possible ways based on multiple conditions.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.