Download presentation
Presentation is loading. Please wait.
Published byNguyễn Hải Modified over 6 years ago
1
Learning Intention I will learn about programming using selection (making choices) with one condition.
2
Analysis Design Implementation Testing Documentation Evaluation
3
Selection (making a choice/decision)
so far the programs you have created have followed the pattern input, process, output (sequence) without doing anything else real world programs need to make decisions and vary their behaviour and output based on these decisions
4
Comparison Operators = Equal to > Greater than < Less than >=
Symbol Meaning = Equal to > Greater than < Less than >= Greater than or equal to <= Less than or equal to <> Not equal
5
True or False A B ? True or False 3 6 A < B True 4 A >= B True
9.5 11.2 B >= A True apples oranges A = B False
6
Simple Selection simple selection means your program makes a decision based on one condition if the condition is true then the code inside it is run
7
Simple Selection e.g. deciding if you can learn to drive
RECEIVE age FROM KEYBOARD IF age >= 17 THEN SEND “you can start learning” TO DISPLAY END IF 18 12
8
Simple Selection VB:
9
Simple Selection also need to be able to do something when the condition is not met (i.e. it is false)
10
Simple Selection e.g. RECEIVE height FROM KEYBOARD IF height < 1.45 THEN SEND “you are too short” TO DISPLAY ELSE SEND “allowed on rollercoaster” TO DISPLAY END IF 1.54 1.35
11
Simple Selection VB:
12
Comparison Operators What will this output?
13
Comparison Operators What will this output?
14
Comparison Operators What will this output?
15
Comparison Operators What will this output?
16
Programming Tasks Complete the tasks on pages 41 -> 44
Write the pseudocode design for tasks 3 -> 6 before programming each one. Get your teacher to check each one before coding it.
17
Success Criteria I can make a program branch the code based on a simple decision.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.