Call Us: 0800 357 9129 West Sussex, United Kingdom

Get Revising!

Selection

What is the definition of this key word?

A statement where the code will only run if a condition is met.

Examples are IF statements & CASE statements
Back to Intro

IF or CASE

Which would you choose if there were 4 possible values to test for?

CASE

CASE statements are a more efficient statement to use when a variable has many possible values to test for. Not all languages support CASE statements.
Back to Intro

Condition

What is the definition of the key word?

A test that creates a True or False outcome

A selective statement tests to see if a condition is true before running the code. Eg. IF 3 > 2 THEN...
Back to Intro

What is the name for an IF inside another IF statement?

Nesting

A statement inside another statement is called nesting. The inner IF will only run if the outer IF is True.
Back to Intro

IF or CASE

Which would you choose if the outcome was either true or false?

IF

IF statements are used when there are only a small number of outcomes for a variable.
Back to Intro

Coding Challenges

Python is an example of a coding language that doesn’t use CASE statements. Complete the code below to include a conditional statement that calculates the grade boundaries of a test (these are example boundaries):

  • 85% = 9
  • 79% = 8
  • 75% = 7
  • 68% = 6
  • 60% = 5
  • 53% = 4
  • 45% = 3
  • 38% = 2
  • 29% = 1

Combining your selection statements with the parameters that are passed into a sub-routine can mean that you can make your sub-routines more efficient.

The code below sends the number 5 into the sub-routine to output the ASCII Art image. Update the program so that it generates a random number between 1 & 5 and outputs a corresponding image.

Download Scribbl.it Notes

The Selection Constructs Scribbl.it Notes provide a structured way for you to revise topic areas in a visual way. You don’t have to be an artist as it’s all been drawn out for you (or you can use this as inspiration to create your own!). Print the notes, then colour in areas of importance, add doodles and colour, then add more detail to the notes page being as creative as possible.

There are known benefits to using Scribbl.it Notes (whether structured like these, or independently created):

  • Increased Attention
  • Reduction of stress levels
  • Increased memory for content
  • Deeper learning

Scroll to the bottom to download

Resize Text
High Contrast