Learning Intention I will learn about selection with multiple conditions.
Analysis Design Implementation Testing Documentation Evaluation
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
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
Multiple Condition Selection In addition to IF … ELSE … END IF we can also use ELSE IF to test multiple conditions
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
Multiple Condition Selection Be careful - only the first TRUE condition met will have the code inside it run
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
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.
Success Criteria I can make a program branch in multiple possible ways based on multiple conditions.