Idea 12of 23Builds onIF … ELSE picks one of two paths
Greater than, less than, equal to
Which numbers does a condition let through?
Today you'll discover
- how to read <, > and =
- what happens right on the edge
- how to say 'or more' in code
Think firstBus fare: children under 6 ride free
A child is exactly 6. What fare does the code give?
Decide first, then press Next. Check the number that sits right on the edge.
A flowchart of the bus fare: a diamond asks Is age < 6?. The yes path leads to SET 0, the no path to SET 3. Along the bottom: age 4 yes to $0, age 9 no to $3, age 6 no to $3 (ringed), age 5 yes to $0. The last step asks where a piece on square 16 ends up when only square 15 climbs the ladder to 27.
See the whole ideathe big idea and the key word, in one place
The big idea
Read the sign: > is greater than, < is less than, = is exactly equal.
Saying 'or more' in code10 or more is number > 9. 6 or less is number < 7. With whole numbers, the edge moves by one.
Easy to get wrongThe small, pointed end of < and > points at the smaller number: 4 < 6 and 6 > 4 say the same thing.
Key word
- comparison
- a condition that compares two numbers with > (greater than), < (less than) or = (equal to)
Ready to use it?
- Say which numbers make a comparison true, including the edge.